Movatterモバイル変換


[0]ホーム

URL:


Host your specs. Generate from anywhere.Get started
Skip to content

Appearance

Fastify v5

v5

WARNING

Fastify plugin is currently in beta. The interface might change before it becomes stable. We encourage you to leave feedback onGitHub.

About

Fastify is a fast and low overhead web framework for Node.js.

The Fastify plugin for Hey API generates route handlers from your OpenAPI spec, fully compatible with all core features.

Collaborators

Features

  • Fastify v5 support
  • seamless integration with@hey-api/openapi-ts ecosystem
  • type-safe route handlers
  • minimal learning curve thanks to extending the underlying technology

Installation

In yourconfiguration, addfastify to your plugins and you'll be ready to generate Fastify artifacts. 🎉

js
export default {  input:'hey-api/backend',// sign up at app.heyapi.dev  output:'src/client',  plugins: [    // ...other plugins    'fastify',  ],};

Output

The Fastify plugin will generate the following artifacts, depending on the input specification.

Route Handlers

Route handlers are generated from all endpoints. The generated interface follows the naming convention of SDK functions.

ts
const fastify = Fastify();const serviceHandlers: RouteHandlers = {  createPets(request,reply) {    reply.code(201).send();  },  listPets(request,reply) {    reply.code(200).send([]);  },  showPetById(request,reply) {    reply.code(200).send({      id:Number(request.params.petId),      name:'Kitty',    });  },};fastify.register(glue, { serviceHandlers });
js
export default {  input:'hey-api/backend',// sign up at app.heyapi.dev  output:'src/client',  plugins: [    // ...other plugins    {      name:'fastify',    },  ],};

API

You can view the complete list of options in theUserConfig interface.

Examples

You can view live examples onStackBlitz.

Sponsors

Hey API is sponsor-funded. If you rely on Hey API in production, consider becoming asponsor to accelerate the roadmap.

Gold

Silver

Bronze

  • Kinde logo

Friends


[8]ページ先頭

©2009-2026 Movatter.jp