diff --git a/.env.example b/.env.example index f9c3dc1..6c41318 100644 --- a/.env.example +++ b/.env.example @@ -4,4 +4,5 @@ DB_HOST=bla DB_PORT=bla DB_USER=bla DB_PASSWORD=bla -DB_NAME=bla \ No newline at end of file +DB_NAME=bla +NODE_ENV=production \ No newline at end of file diff --git a/src/app.ts b/src/app.ts index 488b549..fd902ed 100644 --- a/src/app.ts +++ b/src/app.ts @@ -8,15 +8,16 @@ dotenvSafe.config(); const PORT = process.env.APP_PORT || 4010; const app = createExpressServer({ - controllers: [__dirname + "/controllers/*.ts"], + controllers: [__dirname + "/controllers/*.ts"], + development: process.env.NODE_ENV === "production", }); async function main() { - await loaders(app); - app.listen(PORT, () => { - consola.success( - `⚡️[server]: Server is running at http://localhost:${PORT}` - ); - }); + await loaders(app); + app.listen(PORT, () => { + consola.success( + `⚡️[server]: Server is running at http://localhost:${PORT}` + ); + }); } main();