Created
September 9, 2013 09:46
-
-
Save sbruchmann/6493582 to your computer and use it in GitHub Desktop.
Process GET request via Node.js
This file contains hidden or 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
"use strict"; | |
// Module Dependencies & Initializations | |
var createServer = require("http").createServer; | |
var qs = require("querystring"); | |
var server = createServer(); | |
server.on("request", function onRequest(req, res) { | |
var params = qs.parse(req.url); | |
console.log(params); | |
res.writeHead(204, { | |
Date: (new Date()).toUTCString(), | |
Content-Length: 0 | |
}); | |
res.end(); | |
}); | |
server.listen(3000); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment