Last active
June 27, 2018 13:58
-
-
Save energizer91/9d1ae5b45eb78c4b79886b92c30967d5 to your computer and use it in GitHub Desktop.
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 express = require('express'); | |
const fs = require('fs'); | |
const path = require('path'); | |
const app = express(); | |
app.post('/file', (req, res) => { | |
req.pipe(fs.createWriteStream(path.join(__dirname, 'somefile'))); | |
req.on('end', () => { | |
res.send('done'); | |
}) | |
}); | |
app.listen('3000'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment