From fdaa184562c7f26723621581dbd2387273cbc787 Mon Sep 17 00:00:00 2001 From: dsinghvi Date: Fri, 10 Jan 2025 10:04:30 -0500 Subject: [PATCH] format --- src/server.ts | 35 +++++++++++++++++++++-------------- src/services/imdb.ts | 8 ++++---- 2 files changed, 25 insertions(+), 18 deletions(-) diff --git a/src/server.ts b/src/server.ts index be1af11..e4876ec 100644 --- a/src/server.ts +++ b/src/server.ts @@ -12,21 +12,28 @@ const app = express(); //enable cors app.use(cors()); -register(app, { - imdb, -}, { - storage: multer.diskStorage({ - destination: (req, file, cb) => { - cb(null, '../'); +register( + app, + { + imdb, + }, + { + storage: multer.diskStorage({ + destination: (req, file, cb) => { + cb(null, "../"); + }, + filename: (req, file, cb) => { + cb( + null, + `${file.fieldname}-${Date.now()}${path.extname(file.originalname)}`, + ); + }, + }), + limits: { + fileSize: 1024 * 1024 * 100, // 100MB file size limit for videos }, - filename: (req, file, cb) => { - cb(null, `${file.fieldname}-${Date.now()}${path.extname(file.originalname)}`); - } - }), - limits: { - fileSize: 1024 * 1024 * 100 // 100MB file size limit for videos - } -}); + }, +); app.listen(PORT); console.log(`🎉 Listening on port ${PORT}...`); diff --git a/src/services/imdb.ts b/src/services/imdb.ts index ff4baa0..603341a 100644 --- a/src/services/imdb.ts +++ b/src/services/imdb.ts @@ -22,10 +22,10 @@ export default new ImdbService({ } }, uploadMovie: async (req, res) => { - console.log('Request:', { - file: req.file, - body: req.body, - params: req.params + console.log("Request:", { + file: req.file, + body: req.body, + params: req.params, }); // Handle the uploaded movie await res.send();