From ea62327b008b39dc48a51aa80343b20a0a122cd6 Mon Sep 17 00:00:00 2001 From: Alexander Borisov Date: Wed, 3 Oct 2018 17:50:03 +0300 Subject: Added Node.js support. --- src/nodejs/unit-http/http.js | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100755 src/nodejs/unit-http/http.js (limited to 'src/nodejs/unit-http/http.js') diff --git a/src/nodejs/unit-http/http.js b/src/nodejs/unit-http/http.js new file mode 100755 index 00000000..3a25fa2f --- /dev/null +++ b/src/nodejs/unit-http/http.js @@ -0,0 +1,23 @@ + +/* + * Copyright (C) NGINX, Inc. + */ + +'use strict'; + +const server = require('unit-http/http_server'); + +const { Server } = server; + +function createServer (requestHandler) { + return new Server(requestHandler); +} + + +module.exports = { + Server, + STATUS_CODES: server.STATUS_CODES, + createServer, + IncomingMessage: server.ServerRequest, + ServerResponse: server.ServerResponse +}; -- cgit