Skip to content

Instantly share code, notes, and snippets.

@scarlac
Created May 1, 2019 17:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save scarlac/b8fa1d5d1f2bbdc2dfc0591e6c1efaae to your computer and use it in GitHub Desktop.
Save scarlac/b8fa1d5d1f2bbdc2dfc0591e6c1efaae to your computer and use it in GitHub Desktop.
File Upload Server
const app = require('express')();
const upload = require('multer')();
app.post('/upload', upload.single('file'), function (req, res) {
console.log('file', req.file);
res.status(200).send(JSON.stringify({ ...req.file, buffer: null }));
});
app.listen(4242, () => { console.log('ready.'); });
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment