Upgrade dependencies and migrate from Joi to Zod for validation
This commit is contained in:
parent
4fa0190e4b
commit
a26d0c77a1
12 changed files with 498 additions and 287 deletions
15
src/routes/index.ts
Normal file
15
src/routes/index.ts
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
|
||||
import Router from 'koa-router';
|
||||
import { readdirSync } from 'fs';
|
||||
|
||||
const router = new Router<any, any>();
|
||||
|
||||
readdirSync(__dirname)
|
||||
.filter((file) => file.includes('.route.') && !file.startsWith('health.'))
|
||||
.forEach((file) => {
|
||||
const routesFile = require(`${__dirname}/${file}`).default;
|
||||
router.use(routesFile.routes(), routesFile.allowedMethods());
|
||||
});
|
||||
|
||||
export default router;
|
||||
export { default as healthRoute } from './health.route';
|
||||
Loading…
Add table
Add a link
Reference in a new issue