Skip to content

Instantly share code, notes, and snippets.

@sbruchmann
Created September 9, 2013 09:46
Show Gist options
  • Save sbruchmann/6493582 to your computer and use it in GitHub Desktop.
Save sbruchmann/6493582 to your computer and use it in GitHub Desktop.
Process GET request via Node.js
"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