vortex / src /modules /leetcode /routes /problem.routes.ts
anujjoshi3105's picture
first commit
3d23b0f
raw
history blame contribute delete
859 Bytes
import { FastifyPluginAsync } from 'fastify';
import * as handlers from '../handlers';
import * as schemas from '../schemas';
const problemRoutes: FastifyPluginAsync = async (fastify) => {
fastify.get(
'/daily',
{ schema: schemas.dailyProblemSchema },
handlers.getDailyProblemHandler
);
fastify.get<{ Querystring: { titleSlug: string; raw?: string } }>(
'/select',
{ schema: schemas.selectProblemSchema },
handlers.getSelectProblemHandler
);
fastify.get(
'/list',
{ schema: schemas.listProblemsSchema },
handlers.getProblemsHandler
);
fastify.get<{ Querystring: { titleSlug: string } }>(
'/official-solution',
{ schema: schemas.officialSolutionSchema },
handlers.getOfficialSolutionHandler
);
};
export default problemRoutes;