Skip to content

Instantly share code, notes, and snippets.

@ankur-anand
Last active March 20, 2018 11:04
Show Gist options
  • Save ankur-anand/99c137a22e618fa90efaeb6d8f08da93 to your computer and use it in GitHub Desktop.
Save ankur-anand/99c137a22e618fa90efaeb6d8f08da93 to your computer and use it in GitHub Desktop.
mini-expressjs gist
listen(port, cb) {
const server = http.createServer((req, res) => {
res.statusCode = 200;
res.setHeader("Content-Type", "text/plain");
res.end("Hello World\n");
});
return server.listen.apply(server, arguments);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment