File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -6,14 +6,17 @@ import createError from "http-errors";
66import { HTTP_STATUS , MESSAGES } from "./config/constants.js" ;
77import env from "./config/env.js" ;
88import editRoutes from "./routes/editRoutes.js" ;
9+ import healthRoutes from "./routes/healthRoutes.js" ;
910import videoRoutes from "./routes/videoRoutes.js" ;
1011
1112const app = express ( ) ;
13+
1214app . use ( "/images" , express . static ( "public/images" ) ) ;
1315app . use ( cors ( ) ) ;
1416app . use ( express . json ( ) ) ;
1517app . use ( express . urlencoded ( { extended : true } ) ) ;
1618
19+ app . use ( `${ env . API_PREFIX } /` , healthRoutes ) ;
1720app . use ( `${ env . API_PREFIX } /video` , videoRoutes ) ;
1821app . use ( `${ env . API_PREFIX } /edit` , editRoutes ) ;
1922
Original file line number Diff line number Diff line change 1+ import { HTTP_STATUS } from "../config/constants.js" ;
2+
3+ const healthController = ( req , res ) => {
4+ res . status ( HTTP_STATUS . OK ) . json ( {
5+ OK : "healthCheck" ,
6+ } ) ;
7+ } ;
8+
9+ export default healthController ;
Original file line number Diff line number Diff line change 1+ import express from "express" ;
2+
3+ import healthController from "../controllers/healthController.js" ;
4+
5+ const router = express . Router ( ) ;
6+
7+ router . get ( "/" , healthController ) ;
8+
9+ export default router ;
You can’t perform that action at this time.
0 commit comments