Added Node.js support.

This commit is contained in:
Alexander Borisov
2018-10-03 17:50:03 +03:00
parent 141ee2aa32
commit ea62327b00
13 changed files with 1667 additions and 0 deletions

23
src/nodejs/unit-http/http.js Executable file
View File

@@ -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
};