2022-02-02 11:46:42 +02:00
|
|
|
import express from "express";
|
|
|
|
import apiRoute from "./routes/api.js";
|
|
|
|
import { mainHttpListenPort } from "./config.js";
|
|
|
|
import { bot } from "./common.js";
|
|
|
|
|
2022-02-02 20:24:14 +02:00
|
|
|
// might introduce bugs and probably a bad idea
|
|
|
|
Object.freeze(Object.prototype);
|
|
|
|
Object.freeze(Object);
|
|
|
|
|
|
|
|
|
2022-02-01 03:49:12 +02:00
|
|
|
const app = express();
|
|
|
|
|
|
|
|
app.use(express.json());
|
2022-02-02 20:24:14 +02:00
|
|
|
app.use("/", express.static("frontend/public/"));
|
2022-02-01 03:49:12 +02:00
|
|
|
app.use("/api/v1", apiRoute);
|
|
|
|
|
|
|
|
app.listen(mainHttpListenPort, () => {
|
|
|
|
console.log(`server main: listen on ${mainHttpListenPort}`);
|
2022-02-02 11:46:42 +02:00
|
|
|
bot.connect();
|
2022-02-01 03:49:12 +02:00
|
|
|
});
|