simple-review-server/src/main.ts

18 lines
393 B
TypeScript
Raw Normal View History

import { PostListener } from "./routes";
import express from "express";
2024-08-16 15:04:52 -04:00
import dotenv from "dotenv";
import { Logger } from "./utils";
2024-08-16 15:04:52 -04:00
dotenv.config();
const app = express();
const post = new PostListener(app);
const logger = new Logger("Main");
2024-08-16 15:04:52 -04:00
const port = +process.env.PORT || 8080;
2024-08-16 15:04:52 -04:00
post.start();
2024-08-16 15:04:52 -04:00
app.listen(port, () => {
logger.log(`Server started on http://localhost:${port}`);
});