Skip to content

Commit

Permalink
Resolved #47
Browse files Browse the repository at this point in the history
  • Loading branch information
kolya-mazurok2 committed Aug 13, 2022
1 parent 8413c73 commit b4d856b
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/routes/index.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,21 @@
import { Request, Response, Router } from 'express';
import { errorMessages } from '../errors/constants';
import cityRouter from './city.router';
import forecastRouter from './forecast.router';
import userRouter from './user.router';

const router = Router();

router.get('/ping', (_: Request, res: Response) => {
router.get('/ping', (_: Request, res: Response) =>
res.send({
message: 'pong',
});
});
})
);
router.use('', userRouter);
router.use('/cities', cityRouter);
router.use('/forecasts', forecastRouter);
router.get('*', (_: Request, res: Response) =>
res.status(404).send({ message: errorMessages[404] })
);

export default router;

0 comments on commit b4d856b

Please sign in to comment.