default values for env and critic check for values
This commit is contained in:
parent
b3d1c2d729
commit
d889f92643
8 changed files with 92 additions and 27 deletions
|
@ -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}`);
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue