File size: 859 Bytes
3d23b0f |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
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;
|