Significant API progress
This commit is contained in:
parent
ea72d194c2
commit
01227bb28f
27 changed files with 2378 additions and 0 deletions
21
backend/src/server.ts
Normal file
21
backend/src/server.ts
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
import { config as LoadDotenv } from "dotenv";
|
||||
import winston from "winston";
|
||||
import app from "./app";
|
||||
import { LOGGER } from "./app/util/Logger";
|
||||
import ConnectDb from "./db";
|
||||
|
||||
if (process.env.NODE_ENV !== "production") {
|
||||
LoadDotenv();
|
||||
LOGGER.add(
|
||||
new winston.transports.Console({
|
||||
format: winston.format.simple(),
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
ConnectDb();
|
||||
|
||||
const port = process.env.PORT || 3000;
|
||||
app.listen(port, () =>
|
||||
LOGGER.info(`Server started. Listening on port ${port}`)
|
||||
);
|
||||
Loading…
Reference in a new issue