Open flycran opened 1 year ago
import type { FastifyPluginAsyncTypebox } from '@fastify/type-provider-typebox';
import { Type } from '@sinclair/typebox';
export default (async (app) => {
app.get(
'/hello-world',
{
schema: {
response: {
200: Type.Object({
message: Type.String(),
}),
},
},
},
async (request, reply) => {
return reply.send({
message: 'Hello, World!',
});
},
);
}) as FastifyPluginAsyncTypebox;
Do you want to consider using TypeScript to refactor code to get better TypeScript syntax support? And updated to koa3.