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 · 2 comments
Open

Better TypeScript support #1737

flycran opened this issue Jan 14, 2023 · 2 comments

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;

@kevinpeno kevinpeno self-assigned this Oct 20, 2024
@jonathanong
Copy link
Member

I was against typescript before, but nowadays everything is typescript, so 👍 for a typescript rewrite. unfortunately, I haven't coded in typescript since I haven't been coding much for years, so will need help!

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

5 participants