feat(config): Use toml instead of env

This commit is contained in:
ItzCrazyKns 2024-04-20 09:32:19 +05:30
parent dd1ce4e324
commit c6a5790d33
No known key found for this signature in database
GPG key ID: 8162927C7CCE3065
26 changed files with 799 additions and 596 deletions

View file

@ -3,6 +3,9 @@ import express from 'express';
import cors from 'cors';
import http from 'http';
import routes from './routes';
import { getPort } from './config';
const port = getPort();
const app = express();
const server = http.createServer(app);
@ -19,8 +22,8 @@ app.get('/api', (_, res) => {
res.status(200).json({ status: 'ok' });
});
server.listen(process.env.PORT!, () => {
console.log(`API server started on port ${process.env.PORT}`);
server.listen(port, () => {
console.log(`API server started on port ${port}`);
});
startWebSocketServer(server);