Skip to content

Instantly share code, notes, and snippets.

@energizer91
Last active June 27, 2018 13:58
Show Gist options
  • Save energizer91/9d1ae5b45eb78c4b79886b92c30967d5 to your computer and use it in GitHub Desktop.
Save energizer91/9d1ae5b45eb78c4b79886b92c30967d5 to your computer and use it in GitHub Desktop.
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