Created
July 17, 2014 18:39
-
-
Save alexlafroscia/c09349ebd48f22857dc2 to your computer and use it in GitHub Desktop.
Quick and Dirty Node POST Receiver
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
/* Simple Node POST Server | |
* ================================= | |
* Desc: Prints out the JSON that it receives to the root of the Server | |
* Auth: Alex LaFroscia (@alexlafroscia) | |
* | |
* | |
* How to Use: | |
* ------------------- | |
* Run `node post-receiver.js` from the root of the directory | |
* | |
* | |
* Required NPM packages: | |
* ------------------- | |
* - express | |
* - body-parser | |
* | |
*/ | |
var express = require('express'); | |
var app = express(); | |
var bodyParser = require('body-parser') | |
app.use( bodyParser.json() ); | |
app.post('/', function(req, res){ | |
console.log(req.body); | |
res.send(200); | |
}); | |
app.listen(3000); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment