diff --git a/backend/src/index.ts b/backend/src/index.ts index ab1f808..51bce9b 100644 --- a/backend/src/index.ts +++ b/backend/src/index.ts @@ -1,17 +1,5 @@ -import express from "express"; -import dotenv from "dotenv"; -import * as bodyParser from 'body-parser'; - -import * as routes from "./routes" import {SERVER_PORT} from "./config"; - -dotenv.config(); - -const app = express(); -app.use(bodyParser.json()); - -// Configure routes -routes.register(app); +import app from "./server"; // start the Express server app.listen(SERVER_PORT, () => { diff --git a/backend/src/server.ts b/backend/src/server.ts new file mode 100644 index 0000000..9d3dcd5 --- /dev/null +++ b/backend/src/server.ts @@ -0,0 +1,15 @@ +import express from "express"; +import dotenv from "dotenv"; +import * as bodyParser from 'body-parser'; + +import * as routes from "./routes" + +dotenv.config(); + +const app = express(); +app.use(bodyParser.json()); + +// Configure routes +routes.register(app); + +export default app;