default values for env and critic check for values

This commit is contained in:
Julian Krauser 2024-08-25 18:07:34 +02:00
parent b3d1c2d729
commit d889f92643
8 changed files with 92 additions and 27 deletions

View file

@ -1,6 +1,9 @@
import "dotenv/config";
import express from "express";
import { configCheck, SERVER_PORT } from "./env.defaults";
configCheck();
declare global {
namespace Express {
export interface Request {
@ -18,6 +21,6 @@ dataSource.initialize();
const app = express();
import router from "./routes/index";
router(app);
app.listen(process.env.SERVER_PORT, () => {
console.log(`listening on *:${process.env.SERVER_PORT}`);
app.listen(SERVER_PORT, () => {
console.log(`listening on *:${SERVER_PORT}`);
});