From 29f6b096a2415630fae5ff1040e319971fc6dea2 Mon Sep 17 00:00:00 2001 From: daniel-j Date: Sat, 14 Aug 2021 18:04:26 +0200 Subject: [PATCH] changes --- index.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/index.js b/index.js index 220a569..b6870eb 100644 --- a/index.js +++ b/index.js @@ -13,8 +13,8 @@ const FileType = require('file-type') const port = 3001 const expireDelay = 30 // 30 seconds -const maxExpireDuration = 2 * 60 * 60 // 2 hours -const maxFileSize = 1024 * 1024 * 500 // 500 MB +const maxExpireDuration = 1 * 60 * 60 // 1 hour +const maxFileSize = 1024 * 1024 * 800 // 800 MB const TYPE_EPUB = 'application/epub+zip' const TYPE_MOBI = 'application/x-mobipocket-ebook' @@ -295,7 +295,7 @@ router.post('/upload', upload.single('file'), async ctx => { } flash(ctx, { - message: 'Upload successful!
'+(conversion ? ' Ebook was converted with ' + conversion + ' and sent' : ' Sent')+' to a '+(info.agent.includes('Kobo') ? 'Kobo' : 'Kindle')+' device.
Filename: ' + filename, + message: 'Upload successful!
'+(conversion ? ' Ebook was converted with ' + conversion + ' and sent' : ' Sent')+' to '+(info.agent.includes('Kobo') ? 'a Kobo device.' : (info.agent.includes('Kindle') ? 'a Kindle device.' : 'a device.'))+'
Filename: ' + filename, success: true, key: key }) @@ -338,6 +338,10 @@ router.get('/style.css', async ctx => { await sendfile(ctx, 'style.css') }) +router.get('/receive', async ctx => { + await sendfile(ctx, 'download.html') +}) + router.get('/', async ctx => { const agent = ctx.get('user-agent') console.log(agent)