Fastify 中文文档 (v2.12.1)
Ecosystem
Plugins maintained by the fastify team are listed under Core while plugins maintained by the community are listed in the Community section.
Core
- fastify-acceptsto have accepts in your request object.
- fastify-accepts-serializerto serialize to output according to- Acceptheader.
- fastify-authRun multiple auth functions in Fastify.
- fastify-bankaiBankai assets compiler for Fastify.
- fastify-basic-authBasic auth plugin for Fastify.
- fastify-bearer-authBearer auth plugin for Fastify.
- fastify-cachingGeneral server-side cache and etag support.
- fastify-circuit-breakerA low overhead circuit breaker for your routes.
- fastify-compressFastify compression utils.
- fastify-cookieParse and set cookie headers.
- fastify-corsEnables the use of CORS in a Fastify application.
- fastify-envLoad and check configuration.
- fastify-elasticsearchPlugin to share the same ES client.
- fastify-flashSet and get flash messages using the session.
- fastify-formbodyPlugin to parse x-www-form-urlencoded bodies.
- fastify-helmetImportant security headers for Fastify.
- fastify-http-proxyProxy your http requests to another server, with hooks.
- fastify-jwtJWT utils for Fastify, internally uses jsonwebtoken.
- fastify-leveldbPlugin to share a common LevelDB connection across Fastify.
- fastify-mongodbFastify MongoDB connection plugin, with which you can share the same MongoDB connection pool across every part of your server.
- fastify-multipartMultipart support for Fastify.
- fastify-oauth2Wrap around- simple-oauth2.
- fastify-objectionjsPlugin for the- fastifyframework that provides integration with objectionjs ORM.
- fastify-postgresFastify PostgreSQL connection plugin, with this you can share the same PostgreSQL connection pool in every part of your server.
- fastify-rate-limitA low overhead rate limiter for your routes.
- fastify-response-validationA simple plugin that enables response validation for Fastify.
- fastify-nextjsReact server side rendering support for Fastify with Next.
- fastify-redisFastify Redis connection plugin, with which you can share the same Redis connection across every part of your server.
- fastify-reply-fromPlugin to forward the current http request to another server.
- fastify-routesPlugin that provides a- Mapof routes.
- fastify-sensibleDefaults for Fastify that everyone can agree on. It adds some useful decorators such as http errors and assertions, but also more request and reply methods.
- fastify-staticPlugin for serving static files as fast as possible.
- fastify-swaggerSwagger documentation generator for Fastify.
- fastify-websocketWebSocket support for Fastify. Built upon websocket-stream.
- fastify-url-dataDecorate the- Requestobject with a method to access raw URL components.
- point-of-viewTemplates rendering (ejs, pug, handlebars, marko) plugin support for Fastify.
- under-pressureMeasure process load with automatic handling of "Service Unavailable" plugin for Fastify.
Community
- apollo-server-fastifyRun an Apollo Server to serve GraphQL with Fastify.
- areciboFastify ping responder for Kubernetes Liveness and Readiness Probes.
- cls-rtracerFastify middleware for CLS-based request id generation. An out-of-the-box solution for adding request ids into your logs.
- fastify-405Fastify plugin that adds 405 HTTP status to your routes
- fastify-amqpFastify AMQP connection plugin, to use with RabbitMQ or another connector. Just a wrapper to- amqplib.
- fastify-angular-universalAngular server-side rendering support using- @angular/platform-serverfor Fastify
- fastify-auth0-verify: Auth0 verification plugin for Fastify, internally uses fastify-jwt and jsonwebtoken.
- fastify-autocrudPlugin for autogenerate CRUD routes as fast as possible.
- fastify-axiosPlugin to send HTTP requests via axios.
- fastify-babelFastify plugin for development servers which require babel transformations of JavaScript sources.
- fastify-blippPrints your routes to the console, so you definitely know which endpoints are available.
- fastify-bookshelfFastify plugin to add bookshelf.js orm support.
- fastify-boomFastify plugin to add boom support.
- fastify-caslFastify CASL plugin that supports ACL-like protection of endpoints via either a preSerialization & preHandler hook, sanitizing the inputs and outputs of your application based on user rights.
- fastify-cloudeventsFastify plugin to generate and forward Fastify events in the Cloudevents format.
- fastify-cockroachdbFastify plugin to connect to a CockroachDB PostgreSQL instance via the Sequelize ORM.
- fastify-couchdbFastify plugin to add CouchDB support via nano.
- fastify-csrfA csrf plugin for Fastify.
- fastify-datastoreFastify plugin for Google Cloud Datastore.
- fastify-decoratorsFastify plugin that provides the set of TypeScript decorators.
- fastify-dynamodbAWS DynamoDB plugin for Fastify. It exposes AWS.DynamoDB.DocumentClient() object.
- fastify-error-pageFastify plugin to print errors in structured HTML to the browser.
- fastify-errors-propertiesA error handling plugin for Fastify that enables additional properties in errors.
- fastify-explorerGet control of your decorators across all the encapsulated contexts
- fastify-essoThe easiest authentication plugin for Fastify, with built-in support for Single sign-on (and great documentation)
- fastify-faviconFastify plugin to serve default favicon.
- fastify-feature-flagsFastify feature flags plugin with multiple providers support (e.g. env, config, unleash).
- fastify-file-uploadFastify plugin for uploading files.
- fastify-firebase-authFirebase Authentication for Fastify supporting all of the methods relating to the authentication API.
- fastify-firestoreFastify plugin for Google Cloud Firestore.
- fastify-google-cloud-storageFastify plugin that exposes a GCP Cloud Storage client instance.
- fastify-gqlA GraphQL server implementation for Fastify with caching and- graphql-jit.
- fastify-graceful-shutdownShutdown Fastify gracefully and asynchronously.
- fastify-healthcheckFastify plugin to serve an health check route and a probe script.
- fastify-hemeraFastify Hemera plugin, for writing reliable & fault-tolerant microservices with nats.io.
- fastify-http2httpsRedirect HTTP requests to HTTPS, both using the same port number, or different response on HTTP and HTTPS.
- fastify-https-redirectFastify plugin for auto redirect from http to https
- fastify-http-clientPlugin to send HTTP(s) requests. Built upon urllib.
- fastify-influxdbFastify InfluxDB plugin connecting to an InfluxDB instance via the Influx default package.
- fastify-jwt-authzJWT user scope verifier.
- fastify-jwt-webappJWT authentication for fastify-based web apps.
- fastify-knexjsFastify plugin for support KnexJS Query Builder.
- fastify-knexjs-mockFastify Mock KnexJS for testing support.
- fastify-kubernetesFastify Kubernetes client plugin.
- fastify-language-parserFastify plugin to parse request language.
- fastify-loaderLoad routes from a directory and inject the fastify instance in each file.
- fastify-luredPlugin to load lua scripts with fastify-redis and lured.
- fastify-markdownPlugin to markdown support.
- fastify-metricsPlugin for exporting Prometheus metrics.
- fastify-mongo-memoryFastify MongoDB in Memory Plugin for testing support.
- fastify-mongoose-apiFastify plugin to create REST API methods based on Mongoose MongoDB models.
- fastify-mongoose-driverFastify Mongoose plugin that connects to a MongoDB via the Mongoose plugin with support for Models.
- fastify-multerMulter is a plugin for handling multipart/form-data, which is primarily used for uploading files.
- fastify-natsPlugin to share NATS client across Fastify.
- fastify-no-additional-propertiesAdd- additionalProperties: falseby default to your JSON Schemas.
- fastify-no-iconPlugin to eliminate thrown errors for- /favicon.icorequests.
- fastify-nodemailerPlugin to share nodemailer transporter across Fastify.
- fastify-normalize-request-replyPlugin to normalize the request and reply to the Express version 4.x request and response, which allows use of middleware, like swagger-stats, that was originally written for Express.
- fastify-oasGenerates OpenAPI 3.0+ documentation from routes schemas for Fastify.
- fastify-openapi-glueGlue for Open Api specifications in Fastify, autogenerates routes based on an Open Api Specification
- fastify-oracleAttaches an- oracledbconnection pool to a Fastify server instance.
- fastify-orientdbFastify OrientDB connection plugin, with which you can share the OrientDB connection across every part of your server.
- fastify-qsA plugin for Fastify that adds support for parsing URL query parameters with qs.
- fastify-rbacFastify role-based access control plugin.
- fastify-register-routesPlugin to automatically load routes from a specified path and optionally limit loaded file names by a regular expression.
- fastify-response-timeAdd- X-Response-Timeheader at each request for Fastify, in milliseconds.
- fastify-reverse-routesFastify reverse routes plugin, allows to defined named routes and build path using name and parameters.
- fastify-rob-configFastify Rob-Config integration.
- fastify-schema-constraintChoose the JSON schema to use based on request parameters.
- fastify-secure-sessionCreate a secure stateless cookie session for Fastify
- fastify-sentryFastify plugin to add the Sentry SDK error handler to requests.
- fastify-sequelizeFastify plugin work with Sequelize (adapter for NodeJS -> Sqlite, Mysql, Mssql, Postgres).
- fastify-server-sessionA session plugin with support for arbitrary backing caches via- fastify-caching.
- fastify-sessiona session plugin for Fastify.
- fastify-soap-clienta SOAP client plugin for Fastify.
- fastify-sseto provide Server-Sent Events with- reply.sse( … )to Fastify.
- fastify-tls-keygenAutomatically generate a browser-compatible, trusted, self-signed, localhost-only, TLS certificate.
- fastify-twitch-ebs-toolsUseful functions for Twitch Extension Backend Services (EBS).
- fastify-typeorm-pluginFastify plugin to work with TypeORM.
- fastify-vhostProxy subdomain http requests to another server (useful if you want to point multiple subdomains to the same IP address, while running different servers on the same machine).
- fastify-xml-body-parserParse XML payload / request body into JS / JSON object.
- fastify-vue-pluginNuxt.js plugin for fastify. Control the routes nuxt should use.
- fastify-wamp-routerWeb Application Messaging Protocol router for fastify.
- fast-waterA fastify plugin for waterline. Decorates fastify with waterline models.
- fastify-webpack-hmrWebpack hot module reloading plugin for Fastify.
- fastify-wsWebSocket integration for Fastify — with support for WebSocket lifecycle hooks instead of a single handler function. Built upon ws and uws.
- k-fastify-gatewayAPI Gateway plugin for- fastify, a low footprint implementation that uses the- fastify-reply-fromHTTP proxy library.