bridgecord/index.js

20 lines
519 B
JavaScript
Raw Normal View History

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);
const app = express();
app.use(express.json());
2022-02-02 20:24:14 +02:00
app.use("/", express.static("frontend/public/"));
app.use("/api/v1", apiRoute);
app.listen(mainHttpListenPort, () => {
console.log(`server main: listen on ${mainHttpListenPort}`);
bot.connect();
});