Skip to content

Commit

Permalink
format
Browse files Browse the repository at this point in the history
  • Loading branch information
dsinghvi committed Jan 10, 2025
1 parent 066b493 commit fdaa184
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 18 deletions.
35 changes: 21 additions & 14 deletions src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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}...`);
8 changes: 4 additions & 4 deletions src/services/imdb.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit fdaa184

Please sign in to comment.