-
Notifications
You must be signed in to change notification settings - Fork 97
/
index.js
33 lines (30 loc) · 1.11 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
'use strict';
// Load uWebSockets.js and fundamental Server/Router classes
const uWebsockets = require('uWebSockets.js');
const Server = require('./src/components/Server.js');
const Router = require('./src/components/router/Router.js');
const Request = require('./src/components/http/Request.js');
const Response = require('./src/components/http/Response.js');
const LiveFile = require('./src/components/plugins/LiveFile.js');
const MultipartField = require('./src/components/plugins/MultipartField.js');
const SSEventStream = require('./src/components/plugins/SSEventStream.js');
const Websocket = require('./src/components/ws/Websocket.js');
// Disable the uWebsockets.js version header if not specified to be kept
if (!process.env['KEEP_UWS_HEADER']) {
try {
uWebsockets._cfg('999999990007');
} catch (error) {}
}
// Expose Server and Router classes along with uWebSockets.js constants
module.exports = {
Server,
Router,
Request,
Response,
LiveFile,
MultipartField,
SSEventStream,
Websocket,
compressors: uWebsockets,
express(...args) { return new Server(...args); },
};