Created
May 1, 2019 17:41
-
-
Save scarlac/b8fa1d5d1f2bbdc2dfc0591e6c1efaae to your computer and use it in GitHub Desktop.
File Upload Server
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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