diff --git a/backend/routers/index.ts b/backend/routers/index.ts index 5dc6180..8297a29 100644 --- a/backend/routers/index.ts +++ b/backend/routers/index.ts @@ -23,6 +23,9 @@ bb.extend(router, { // Render or redirect router.get('/', (req, res) => UserConfig.ready ? res.render('index') : res.redirect('/setup')); +// temp file map +const files = new Map(); + // Upload flow router.post('/', async (req, res) => { @@ -72,11 +75,13 @@ router.post('/', async (req, res) => { await fs.rm(bbFile.file); // todo: get S3 save data + assFile.save.s3 = true; } log.debug('File saved to', !s3 ? assFile.save.local! : 'S3'); // todo: save metadata + files.set(assFile.fakeid, assFile); return res.type('json').send({ resource: `${req.ass.host}/${assFile.fakeid}` }); } catch (err) {