-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdebug.js
More file actions
20 lines (18 loc) · 784 Bytes
/
debug.js
File metadata and controls
20 lines (18 loc) · 784 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
"use strict";
const BasicHTTPServer = require("./index");
// const fileHandlerTest = new StaticFileServer("/test", "./", "index.html");
// const fileHandlerTest2 = new StaticFileServer("/test2", "./", "index.html");
// const fileHandler = new StaticFileServer("/", "./", "index.html");
const httpServer = new BasicHTTPServer.MicroService({useHttp: true, useHttps: true});
// httpServer.registerHandler(fileHandlerTest2);
// httpServer.registerHandler(fileHandlerTest);
// httpServer.registerDefaultHandler(fileHandler);
httpServer.start();
console.log("HTTP Server has started on port: " + httpServer.port);
console.log("HTTPS Server has started on port: " + httpServer.sslPort);
httpServer.stop((err) => {
if (err) {
console.log(err);
}
console.log("Done");
});