Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better TypeScript support #1737

Open
flycran opened this issue Jan 14, 2023 · 1 comment
Open

Better TypeScript support #1737

flycran opened this issue Jan 14, 2023 · 1 comment

Comments

@flycran
Copy link

flycran commented Jan 14, 2023

Do you want to consider using TypeScript to refactor code to get better TypeScript syntax support? And updated to koa3.

@Shyam-Chen
Copy link

Shyam-Chen commented Jun 16, 2023

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;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants