From d0eceeeb13cac2692515f4d2586ecdc0b12eb566 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Chif=20Gerg=C5=91?= <chif@sch.bme.hu> Date: Sun, 23 Feb 2020 15:11:32 +0100 Subject: [PATCH] Initialize routes --- nodemon.json | 2 +- src/index.ts | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/nodemon.json b/nodemon.json index 4df56ed0..70a9d667 100644 --- a/nodemon.json +++ b/nodemon.json @@ -2,5 +2,5 @@ "watch": ["src"], "ext": "ts", "ignore": ["src/public"], - "exec": "NODE_ENV=development ts-node src/index.ts" + "exec": "ts-node src/index.ts" } diff --git a/src/index.ts b/src/index.ts index e880caa5..6d84fb60 100644 --- a/src/index.ts +++ b/src/index.ts @@ -3,6 +3,7 @@ import express, { Request, Response, NextFunction, Application } from "express"; import bodyParser from "body-parser"; import expressSession from "express-session"; import authRoute from './routes/auth'; +import newsRoute from './routes/news'; const app: Application = express(); @@ -25,6 +26,9 @@ app.get("/", (req: Request, res: Response) => { // Register routes authRoute(app); +// Register routes +newsRoute(app); + app.use((err: any, req: Request, res: Response, next: NextFunction) => { res.status(500).send("Houston, we have a problem!"); -- GitLab