diff --git a/backend-services/friend-service/src/Startup/routes.ts b/backend-services/friend-service/src/Startup/routes.ts new file mode 100644 index 0000000000000000000000000000000000000000..846ca55379d01435841d7a381e499845762a4533 --- /dev/null +++ b/backend-services/friend-service/src/Startup/routes.ts @@ -0,0 +1,20 @@ +import express, { Application } from 'express' +import { authorize } from '../Middleware/Auth' +import { IndexRouter } from '../Routes' +import { FriendsRouter } from '../Routes/FriendsRouter' +import { RequestRouter } from '../Routes/RequestsRouter' + +/** + * Load the application endpoints + * @param app + */ +export const initializeRoutes = (app: Application) => { + app.use(express.json()) + + // load index routes + app.use('/', IndexRouter) + + //Other routes + app.use('/friends', authorize, FriendsRouter) + app.use('/friends/requests', authorize, RequestRouter) +} \ No newline at end of file