Initial commit
This commit is contained in:
22
src/main.ts
Normal file
22
src/main.ts
Normal file
@@ -0,0 +1,22 @@
|
||||
import Logging from "log-like-a-zombie";
|
||||
import express from "express";
|
||||
|
||||
const log = new Logging("Main");
|
||||
|
||||
const port = 3000;
|
||||
const address = "127.0.0.1";
|
||||
|
||||
log.i(`Starting HTTP server on http://${address}:${port}`);
|
||||
|
||||
const app = express();
|
||||
app.disable('etag');
|
||||
app.disable('x-powered-by');
|
||||
|
||||
app.use((rq: express.Request, rs: express.Response) => {
|
||||
log.n(`${rq.ip} ${rq.method} ${rq.originalUrl}`);
|
||||
rs.sendStatus(200);
|
||||
});
|
||||
|
||||
app.listen(port, address, () => {
|
||||
log.i(`Listening on http://${address}:${port}`);
|
||||
});
|
||||
Reference in New Issue
Block a user