21 lines
729 B
TypeScript
Raw Normal View History

2023-05-19 15:22:48 -03:00
import http from "http";
import https from "https";
import fs from "node:fs";
import { app } from "./app";
2024-01-06 16:26:58 +01:00
import { logger } from "./utils/logger";
2023-05-19 15:22:48 -03:00
//const morgan = require("morgan");
//const bodyParser = require("body-parser");
const options = {
key: fs.readFileSync("static/certs/key.pem"),
cert: fs.readFileSync("static/certs/cert.pem"),
passphrase: "123456"
2023-05-19 15:22:48 -03:00
};
// const server = http.createServer(app).listen(80);
2024-01-06 16:26:58 +01:00
http.createServer(app).listen(80, () => logger.info("cache server started on port 80"));
const server = https.createServer(options, app).listen(443, () => logger.info("game server started on port 443"));
2023-05-19 15:22:48 -03:00
// server.keepAliveTimeout = 60 * 1000 + 1000;
// server.headersTimeout = 60 * 1000 + 2000;