A social knowledge tool for researchers built on ATProto

Merge pull request #97 from cosmik-network/feature/ping-endpoint

Feature/ping endpoint

authored by

Wesley Finck and committed by
GitHub
38d858dc df7d9eb3

+15
+5
src/shared/infrastructure/http/app.ts
··· 7 7 import { createCardsModuleRoutes } from '../../../modules/cards/infrastructure/http/routes'; 8 8 import { createFeedRoutes } from '../../../modules/feeds/infrastructure/http/routes/feedRoutes'; 9 9 import { createSearchRoutes } from '../../../modules/search/infrastructure/http/routes/searchRoutes'; 10 + import { createTestRoutes } from './routes/testRoutes'; 10 11 import { 11 12 EnvironmentConfigService, 12 13 Environment, ··· 124 125 controllers.getSimilarUrlsForUrlController, 125 126 ); 126 127 128 + const testRouter = Router(); 129 + createTestRoutes(testRouter); 130 + 127 131 // Register routes 128 132 app.use('/api/users', userRouter); 129 133 app.use('/atproto', atprotoRouter); 130 134 app.use('/api', cardsRouter); 131 135 app.use('/api/feeds', feedRouter); 132 136 app.use('/api/search', searchRouter); 137 + app.use('/api/test', testRouter); 133 138 134 139 return app; 135 140 };
+10
src/shared/infrastructure/http/routes/testRoutes.ts
··· 1 + import { Router, Request, Response } from 'express'; 2 + 3 + export const createTestRoutes = (router: Router) => { 4 + // Simple ping/pong endpoint for performance testing 5 + router.get('/ping', (req: Request, res: Response) => { 6 + res.json({ message: 'pong' }); 7 + }); 8 + 9 + return router; 10 + };