import { FastifyInstance } from 'fastify'; import { AdderController, AdderControllerImpl } from '@/modules/adder'; export const addRoutes = (server: FastifyInstance) => { const adderController: AdderController = new AdderControllerImpl(); return server .route({ method: 'POST', url: '/add', schema: { body: { type: 'object', properties: { a: { type: 'number' }, b: { type: 'number' }, } } }, handler: adderController.addNumbers, }) .route({ method: 'POST', url: '/subtract', schema: { body: { type: 'object', properties: { a: { type: 'number' }, b: { type: 'number' }, } } }, handler: adderController.subtractNumbers, }); };