spur-common
Version:
A Node.JS library of common modules used as a base to most Node.JS applications.
15 lines (11 loc) • 329 B
JavaScript
const http = require('http');
const server = http.createServer(function (req, res) {
res.writeHead(200, {'Content-Type': 'text/plain'});
res.end(JSON.stringify(req.headers));
});
exports.listen = function () {
server.listen.apply(server, arguments);
};
exports.close = function (callback) {
server.close(callback);
};