git.schokokeks.org
Repositories
Help
Report an Issue
fs-words.git
Code
Commits
Branches
Tags
Suche
Strukturansicht:
6e9c872
Branches
Tags
develop-client_server
master
typescript
fs-words.git
server
lib
node_modules
needle
test
utils
formidable.js
[add] server:lib:node_modules
Christian Fraß
commited
6e9c872
at 2021-03-08 23:52:07
formidable.js
Blame
History
Raw
var formidable = require('formidable'), http = require('http'), util = require('util'); var port = process.argv[2] || 8888; http.createServer(function(req, res) { var form = new formidable.IncomingForm(); form.parse(req, function(err, fields, files) { res.writeHead(200, {'content-type': 'text/plain'}); res.write('received upload:\n\n'); console.log(util.inspect({fields: fields, files: files})) res.end(util.inspect({fields: fields, files: files})); }); }).listen(port); console.log('HTTP server listening on port ' + port);