Skip to content
Snippets Groups Projects
Commit d0eceeeb authored by chif's avatar chif Committed by Chif Gergő
Browse files

Initialize routes

parent ed42c9f8
No related branches found
No related tags found
2 merge requests!10Feature/12 dev auto deploy,!6Feature/news api
...@@ -2,5 +2,5 @@ ...@@ -2,5 +2,5 @@
"watch": ["src"], "watch": ["src"],
"ext": "ts", "ext": "ts",
"ignore": ["src/public"], "ignore": ["src/public"],
"exec": "NODE_ENV=development ts-node src/index.ts" "exec": "ts-node src/index.ts"
} }
...@@ -3,6 +3,7 @@ import express, { Request, Response, NextFunction, Application } from "express"; ...@@ -3,6 +3,7 @@ import express, { Request, Response, NextFunction, Application } from "express";
import bodyParser from "body-parser"; import bodyParser from "body-parser";
import expressSession from "express-session"; import expressSession from "express-session";
import authRoute from './routes/auth'; import authRoute from './routes/auth';
import newsRoute from './routes/news';
const app: Application = express(); const app: Application = express();
...@@ -25,6 +26,9 @@ app.get("/", (req: Request, res: Response) => { ...@@ -25,6 +26,9 @@ app.get("/", (req: Request, res: Response) => {
// Register routes // Register routes
authRoute(app); authRoute(app);
// Register routes
newsRoute(app);
app.use((err: any, req: Request, res: Response, next: NextFunction) => { app.use((err: any, req: Request, res: Response, next: NextFunction) => {
res.status(500).send("Houston, we have a problem!"); res.status(500).send("Houston, we have a problem!");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment