fastify 3.24.0 → 3.25.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (67) hide show
  1. package/README.md +30 -29
  2. package/docs/{Benchmarking.md → Guides/Benchmarking.md} +14 -5
  3. package/docs/Guides/Ecosystem.md +513 -0
  4. package/docs/{Fluent-Schema.md → Guides/Fluent-Schema.md} +16 -7
  5. package/docs/{Getting-Started.md → Guides/Getting-Started.md} +180 -60
  6. package/docs/Guides/Index.md +30 -4
  7. package/docs/{Migration-Guide-V3.md → Guides/Migration-Guide-V3.md} +43 -37
  8. package/docs/{Plugins-Guide.md → Guides/Plugins-Guide.md} +196 -82
  9. package/docs/{Recommendations.md → Guides/Recommendations.md} +17 -10
  10. package/docs/{Serverless.md → Guides/Serverless.md} +200 -42
  11. package/docs/Guides/Style-Guide.md +246 -0
  12. package/docs/{Testing.md → Guides/Testing.md} +26 -12
  13. package/docs/Guides/Write-Plugin.md +102 -0
  14. package/docs/{ContentTypeParser.md → Reference/ContentTypeParser.md} +68 -30
  15. package/docs/{Decorators.md → Reference/Decorators.md} +52 -47
  16. package/docs/{Encapsulation.md → Reference/Encapsulation.md} +3 -3
  17. package/docs/{Errors.md → Reference/Errors.md} +77 -47
  18. package/docs/{HTTP2.md → Reference/HTTP2.md} +13 -13
  19. package/docs/{Hooks.md → Reference/Hooks.md} +157 -70
  20. package/docs/Reference/Index.md +71 -0
  21. package/docs/{LTS.md → Reference/LTS.md} +31 -32
  22. package/docs/{Lifecycle.md → Reference/Lifecycle.md} +15 -7
  23. package/docs/{Logging.md → Reference/Logging.md} +68 -28
  24. package/docs/Reference/Middleware.md +78 -0
  25. package/docs/{Plugins.md → Reference/Plugins.md} +91 -34
  26. package/docs/{Reply.md → Reference/Reply.md} +205 -94
  27. package/docs/{Request.md → Reference/Request.md} +32 -16
  28. package/docs/{Routes.md → Reference/Routes.md} +243 -113
  29. package/docs/{Server.md → Reference/Server.md} +516 -267
  30. package/docs/{TypeScript.md → Reference/TypeScript.md} +451 -191
  31. package/docs/{Validation-and-Serialization.md → Reference/Validation-and-Serialization.md} +178 -86
  32. package/docs/index.md +24 -0
  33. package/examples/typescript-server.ts +1 -1
  34. package/fastify.js +2 -3
  35. package/lib/contentTypeParser.js +11 -6
  36. package/lib/decorate.js +6 -3
  37. package/lib/logger.js +1 -1
  38. package/lib/route.js +1 -1
  39. package/lib/server.js +9 -8
  40. package/package.json +9 -4
  41. package/test/als.test.js +74 -0
  42. package/test/constrained-routes.test.js +220 -0
  43. package/test/custom-parser.test.js +11 -2
  44. package/test/decorator.test.js +38 -0
  45. package/test/handler-context.test.js +11 -4
  46. package/test/http2/closing.test.js +14 -5
  47. package/test/http2/constraint.test.js +91 -0
  48. package/test/listen.test.js +36 -22
  49. package/test/logger.test.js +16 -0
  50. package/test/maxRequestsPerSocket.test.js +10 -0
  51. package/test/request-error.test.js +2 -8
  52. package/test/requestTimeout.test.js +4 -1
  53. package/test/router-options.test.js +10 -1
  54. package/test/schema-feature.test.js +146 -0
  55. package/test/stream.test.js +14 -3
  56. package/test/trust-proxy.test.js +15 -7
  57. package/test/types/instance.test-d.ts +52 -1
  58. package/test/types/request.test-d.ts +7 -1
  59. package/test/types/route.test-d.ts +21 -0
  60. package/types/hooks.d.ts +12 -1
  61. package/types/instance.d.ts +16 -6
  62. package/types/request.d.ts +4 -1
  63. package/types/route.d.ts +1 -1
  64. package/docs/Ecosystem.md +0 -211
  65. package/docs/Middleware.md +0 -53
  66. package/docs/Style-Guide.md +0 -185
  67. package/docs/Write-Plugin.md +0 -58
@@ -0,0 +1,513 @@
1
+ <h1 align="center">Fastify</h1>
2
+
3
+ ## Ecosystem
4
+
5
+ Plugins maintained by the Fastify team are listed under [Core](#core) while
6
+ plugins maintained by the community are listed in the [Community](#community)
7
+ section.
8
+
9
+ #### [Core](#core)
10
+
11
+ - [`fastify-accepts`](https://github.com/fastify/fastify-accepts) to have
12
+ [accepts](https://www.npmjs.com/package/accepts) in your request object.
13
+ - [`fastify-accepts-serializer`](https://github.com/fastify/fastify-accepts-serializer)
14
+ to serialize to output according to `Accept` header.
15
+ - [`fastify-auth`](https://github.com/fastify/fastify-auth) Run multiple auth
16
+ functions in Fastify.
17
+ - [`fastify-autoload`](https://github.com/fastify/fastify-autoload) Require all
18
+ plugins in a directory.
19
+ - [`fastify-awilix`](https://github.com/fastify/fastify-awilix) Dependency
20
+ injection support for Fastify, based on
21
+ [awilix](https://github.com/jeffijoe/awilix).
22
+ - [`fastify-bankai`](https://github.com/fastify/fastify-bankai)
23
+ [Bankai](https://github.com/yoshuawuyts/bankai) assets compiler for Fastify.
24
+ - [`fastify-basic-auth`](https://github.com/fastify/fastify-basic-auth) Basic
25
+ auth plugin for Fastify.
26
+ - [`fastify-bearer-auth`](https://github.com/fastify/fastify-bearer-auth) Bearer
27
+ auth plugin for Fastify.
28
+ - [`fastify-caching`](https://github.com/fastify/fastify-caching) General
29
+ server-side cache and ETag support.
30
+ - [`fastify-circuit-breaker`](https://github.com/fastify/fastify-circuit-breaker)
31
+ A low overhead circuit breaker for your routes.
32
+ - [`fastify-compress`](https://github.com/fastify/fastify-compress) Fastify
33
+ compression utils.
34
+ - [`fastify-cookie`](https://github.com/fastify/fastify-cookie) Parse and set
35
+ cookie headers.
36
+ - [`fastify-cors`](https://github.com/fastify/fastify-cors) Enables the use of
37
+ CORS in a Fastify application.
38
+ - [`fastify-csrf`](https://github.com/fastify/fastify-csrf) A plugin for adding
39
+ [CSRF](https://en.wikipedia.org/wiki/Cross-site_request_forgery) protection to
40
+ Fastify.
41
+ - [`fastify-diagnostics-channel`](https://github.com/fastify/fastify-diagnostics-channel)
42
+ Plugin to deal with `diagnostics_channel` on Fastify
43
+ - [`fastify-elasticsearch`](https://github.com/fastify/fastify-elasticsearch)
44
+ Plugin to share the same ES client.
45
+ - [`fastify-env`](https://github.com/fastify/fastify-env) Load and check
46
+ configuration.
47
+ - [`fastify-etag`](https://github.com/fastify/fastify-etag) Automatically
48
+ generate ETags for HTTP responses.
49
+ - [`fastify-flash`](https://github.com/fastify/fastify-flash) Set and get flash
50
+ messages using the session.
51
+ - [`fastify-formbody`](https://github.com/fastify/fastify-formbody) Plugin to
52
+ parse x-www-form-urlencoded bodies.
53
+ - [`fastify-funky`](https://github.com/fastify/fastify-funky) Makes functional
54
+ programming in Fastify more convenient. Adds support for Fastify routes
55
+ returning functional structures, such as Either, Task or plain parameterless
56
+ function.
57
+ - [`fastify-helmet`](https://github.com/fastify/fastify-helmet) Important
58
+ security headers for Fastify.
59
+ - [`fastify-http-proxy`](https://github.com/fastify/fastify-http-proxy) Proxy
60
+ your HTTP requests to another server, with hooks.
61
+ - [`fastify-jwt`](https://github.com/fastify/fastify-jwt) JWT utils for Fastify,
62
+ internally uses [jsonwebtoken](https://github.com/auth0/node-jsonwebtoken).
63
+ - [`fastify-leveldb`](https://github.com/fastify/fastify-leveldb) Plugin to
64
+ share a common LevelDB connection across Fastify.
65
+ - [`fastify-mongodb`](https://github.com/fastify/fastify-mongodb) Fastify
66
+ MongoDB connection plugin, with which you can share the same MongoDB
67
+ connection pool across every part of your server.
68
+ - [`fastify-multipart`](https://github.com/fastify/fastify-multipart) Multipart
69
+ support for Fastify.
70
+ - [`fastify-oauth2`](https://github.com/fastify/fastify-oauth2) Wrap around
71
+ [`simple-oauth2`](https://github.com/lelylan/simple-oauth2).
72
+ - [`fastify-postgres`](https://github.com/fastify/fastify-postgres) Fastify
73
+ PostgreSQL connection plugin, with this you can share the same PostgreSQL
74
+ connection pool in every part of your server.
75
+ - [`fastify-rate-limit`](https://github.com/fastify/fastify-rate-limit) A low
76
+ overhead rate limiter for your routes.
77
+ - [`fastify-request-context`](https://github.com/fastify/fastify-request-context)
78
+ Request-scoped storage, based on
79
+ [AsyncLocalStorage](https://nodejs.org/api/async_hooks.html#async_hooks_class_asynclocalstorage)
80
+ (with fallback to [cls-hooked](https://github.com/Jeff-Lewis/cls-hooked)),
81
+ providing functionality similar to thread-local storages.
82
+ - [`fastify-response-validation`](https://github.com/fastify/fastify-response-validation)
83
+ A simple plugin that enables response validation for Fastify.
84
+ - [`fastify-nextjs`](https://github.com/fastify/fastify-nextjs) React
85
+ server-side rendering support for Fastify with
86
+ [Next](https://github.com/zeit/next.js/).
87
+ - [`fastify-redis`](https://github.com/fastify/fastify-redis) Fastify Redis
88
+ connection plugin, with which you can share the same Redis connection across
89
+ every part of your server.
90
+ - [`fastify-reply-from`](https://github.com/fastify/fastify-reply-from) Plugin
91
+ to forward the current HTTP request to another server.
92
+ - [`fastify-routes`](https://github.com/fastify/fastify-routes) Plugin that
93
+ provides a `Map` of routes.
94
+ - [`fastify-schedule`](https://github.com/fastify/fastify-schedule) Plugin for
95
+ scheduling periodic jobs, based on
96
+ [toad-scheduler](https://github.com/kibertoad/toad-scheduler).
97
+ - [`fastify-sensible`](https://github.com/fastify/fastify-sensible) Defaults for
98
+ Fastify that everyone can agree on. It adds some useful decorators such as
99
+ HTTP errors and assertions, but also more request and reply methods.
100
+ - [`@fastify/session`](https://github.com/fastify/session) a session plugin for
101
+ Fastify.
102
+ - [`fastify-static`](https://github.com/fastify/fastify-static) Plugin for
103
+ serving static files as fast as possible.
104
+ - [`fastify-swagger`](https://github.com/fastify/fastify-swagger) Plugin for
105
+ serving Swagger/OpenAPI documentation for Fastify, supporting dynamic
106
+ generation.
107
+ - [`fastify-websocket`](https://github.com/fastify/fastify-websocket) WebSocket
108
+ support for Fastify. Built upon [ws](https://github.com/websockets/ws).
109
+ - [`fastify-url-data`](https://github.com/fastify/fastify-url-data) Decorate the
110
+ `Request` object with a method to access raw URL components.
111
+ - [`middie`](https://github.com/fastify/middie) Middleware engine for Fastify.
112
+ - [`point-of-view`](https://github.com/fastify/point-of-view) Templates
113
+ rendering (_ejs, pug, handlebars, marko_) plugin support for Fastify.
114
+ - [`under-pressure`](https://github.com/fastify/under-pressure) Measure process
115
+ load with automatic handling of _"Service Unavailable"_ plugin for Fastify.
116
+
117
+ #### [Community](#community)
118
+
119
+ - [`@applicazza/fastify-nextjs`](https://github.com/applicazza/fastify-nextjs)
120
+ Alternate Fastify and Next.js integration.
121
+ - [`@coobaha/typed-fastify`](https://github.com/Coobaha/typed-fastify) Strongly
122
+ typed routes with a runtime validation using JSON schema generated from types.
123
+ - [`@dnlup/fastify-doc`](https://github.com/dnlup/fastify-doc) A plugin for
124
+ sampling process metrics.
125
+ - [`@dnlup/fastify-traps`](https://github.com/dnlup/fastify-traps) A plugin to
126
+ close the server gracefully on `SIGINT` and `SIGTERM` signals.
127
+ - [`@gquittet/graceful-server`](https://github.com/gquittet/graceful-server)
128
+ Tiny (~5k), Fast, KISS, and dependency-free Node.JS library to make your
129
+ Fastify API graceful.
130
+ - [`@immobiliarelabs/fastify-metrics`](https://github.com/immobiliare/fastify-metrics)
131
+ Minimalistic and opinionated plugin that collects usage/process metrics and
132
+ dispatches to [statsd](https://github.com/statsd/statsd).
133
+ - [`@mgcrea/fastify-graceful-exit`](https://github.com/mgcrea/fastify-graceful-exit)
134
+ A plugin to close the server gracefully
135
+ - [`@mgcrea/fastify-request-logger`](https://github.com/mgcrea/fastify-request-logger)
136
+ A plugin to enable compact request logging for Fastify
137
+ - [`@mgcrea/fastify-session-redis-store`](https://github.com/mgcrea/fastify-session-redis-store)
138
+ Redis store for @mgcrea/fastify-session using ioredis
139
+ - [`@mgcrea/fastify-session-sodium-crypto`](https://github.com/mgcrea/fastify-session-sodium-crypto)
140
+ Fast sodium-based crypto for @mgcrea/fastify-session
141
+ - [`@mgcrea/fastify-session`](https://github.com/mgcrea/fastify-session) Session
142
+ plugin for Fastify that supports both stateless and stateful sessions
143
+ - [`@mgcrea/pino-pretty-compact`](https://github.com/mgcrea/pino-pretty-compact)
144
+ A custom compact pino-base prettifier
145
+ - [`@trubavuong/fastify-seaweedfs`](https://github.com/trubavuong/fastify-seaweedfs)
146
+ SeaweedFS for Fastify
147
+ - [`apollo-server-fastify`](https://github.com/apollographql/apollo-server/tree/master/packages/apollo-server-fastify)
148
+ Run an [Apollo Server](https://github.com/apollographql/apollo-server) to
149
+ serve GraphQL with Fastify.
150
+ - [`arecibo`](https://github.com/nucleode/arecibo) Fastify ping responder for
151
+ Kubernetes Liveness and Readiness Probes.
152
+ - [`cls-rtracer`](https://github.com/puzpuzpuz/cls-rtracer) Fastify middleware
153
+ for CLS-based request ID generation. An out-of-the-box solution for adding
154
+ request IDs into your logs.
155
+ - [`fastify-405`](https://github.com/Eomm/fastify-405) Fastify plugin that adds
156
+ 405 HTTP status to your routes
157
+ - [`fastify-allow`](https://github.com/mattbishop/fastify-allow) Fastify plugin
158
+ that automatically adds an Allow header to responses with routes. Also sends
159
+ 405 responses for routes that have a handler but not for the request's method.
160
+ - [`fastify-amqp`](https://github.com/RafaelGSS/fastify-amqp) Fastify AMQP
161
+ connection plugin, to use with RabbitMQ or another connector. Just a wrapper
162
+ to [`amqplib`](https://github.com/squaremo/amqp.node).
163
+ - [`fastify-angular-universal`](https://github.com/exequiel09/fastify-angular-universal)
164
+ Angular server-side rendering support using
165
+ [`@angular/platform-server`](https://github.com/angular/angular/tree/master/packages/platform-server)
166
+ for Fastify
167
+ - [`fastify-api-key`](https://github.com/arkerone/fastify-api-key) Fastify
168
+ plugin to authenticate HTTP requests based on api key and signature
169
+ - [`fastify-appwrite`](https://github.com/Dev-Manny/fastify-appwrite) Fastify
170
+ Plugin for interacting with Appwrite server.
171
+ - [`fastify-auth0-verify`](https://github.com/nearform/fastify-auth0-verify):
172
+ Auth0 verification plugin for Fastify, internally uses
173
+ [fastify-jwt](https://npm.im/fastify-jwt) and
174
+ [jsonwebtoken](https://npm.im/jsonwebtoken).
175
+ - [`fastify-autocrud`](https://github.com/paranoiasystem/fastify-autocrud)
176
+ Plugin to auto-generate CRUD routes as fast as possible.
177
+ - [`fastify-autoroutes`](https://github.com/GiovanniCardamone/fastify-autoroutes)
178
+ Plugin to scan and load routes based on filesystem path from a custom
179
+ directory.
180
+ - [`fastify-axios`](https://github.com/davidedantonio/fastify-axios) Plugin to
181
+ send HTTP requests via [axios](https://github.com/axios/axios).
182
+ - [`fastify-babel`](https://github.com/cfware/fastify-babel) Fastify plugin for
183
+ development servers that require Babel transformations of JavaScript sources.
184
+ - [`fastify-bcrypt`](https://github.com/heply/fastify-bcrypt) A Bcrypt hash
185
+ generator & checker.
186
+ - [`fastify-blipp`](https://github.com/PavelPolyakov/fastify-blipp) Prints your
187
+ routes to the console, so you definitely know which endpoints are available.
188
+ - [`fastify-bookshelf`](https://github.com/butlerx/fastify-bookshelfjs) Fastify
189
+ plugin to add [bookshelf.js](https://bookshelfjs.org/) ORM support.
190
+ - [`fastify-boom`](https://github.com/jeromemacias/fastify-boom) Fastify plugin
191
+ to add [boom](https://github.com/hapijs/boom) support.
192
+ - [`fastify-bree`](https://github.com/climba03003/fastify-bree) Fastify plugin
193
+ to add [bree](https://github.com/breejs/bree) support.
194
+ - [`fastify-casbin`](https://github.com/nearform/fastify-casbin) Casbin support
195
+ for Fastify.
196
+ - [`fastify-casbin-rest`](https://github.com/nearform/fastify-casbin-rest)
197
+ Casbin support for Fastify based on a RESTful model.
198
+ - [`fastify-casl`](https://github.com/Inlecom/fastify-casl) Fastify
199
+ [CASL](https://github.com/stalniy/casl) plugin that supports ACL-like
200
+ protection of endpoints via either a preSerialization & preHandler hook,
201
+ sanitizing the inputs and outputs of your application based on user rights.
202
+ - [`fastify-cloudevents`](https://github.com/smartiniOnGitHub/fastify-cloudevents)
203
+ Fastify plugin to generate and forward Fastify events in the Cloudevents
204
+ format.
205
+ - [`fastify-cockroachdb`](https://github.com/alex-ppg/fastify-cockroachdb)
206
+ Fastify plugin to connect to a CockroachDB PostgreSQL instance via the
207
+ Sequelize ORM.
208
+ - [`fastify-couchdb`](https://github.com/nigelhanlon/fastify-couchdb) Fastify
209
+ plugin to add CouchDB support via [nano](https://github.com/apache/nano).
210
+ - [`fastify-crud-generator`](https://github.com/heply/fastify-crud-generator) A
211
+ plugin to rapidly generate CRUD routes for any entity.
212
+ - [`fastify-custom-healthcheck`](https://github.com/gkampitakis/fastify-custom-healthcheck)
213
+ Fastify plugin to add health route in your server that asserts custom
214
+ functions.
215
+ - [`fastify-decorators`](https://github.com/L2jLiga/fastify-decorators) Fastify
216
+ plugin that provides the set of TypeScript decorators.
217
+ - [`fastify-disablecache`](https://github.com/Fdawgs/fastify-disablecache)
218
+ Fastify plugin to disable client-side caching, inspired by
219
+ [nocache](https://github.com/helmetjs/nocache).
220
+ - [`fastify-dynamodb`](https://github.com/matrus2/fastify-dynamodb) AWS DynamoDB
221
+ plugin for Fastify. It exposes
222
+ [AWS.DynamoDB.DocumentClient()](https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/DynamoDB/DocumentClient.html)
223
+ object.
224
+ - [`fastify-dynareg`](https://github.com/greguz/fastify-dynareg) Dynamic plugin
225
+ register for Fastify.
226
+ - [`fastify-early-hints`](https://github.com/zekth/fastify-early-hints) Plugin
227
+ to add HTTP 103 feature based on [RFC
228
+ 8297](https://httpwg.org/specs/rfc8297.html)
229
+ - [`fastify-envalid`](https://github.com/alemagio/fastify-envalid) Fastify
230
+ plugin to integrate [envalid](https://github.com/af/envalid) in your Fastify
231
+ project.
232
+ - [`fastify-error-page`](https://github.com/hemerajs/fastify-error-page) Fastify
233
+ plugin to print errors in structured HTML to the browser.
234
+ - [`fastify-esso`](https://github.com/patrickpissurno/fastify-esso) The easiest
235
+ authentication plugin for Fastify, with built-in support for Single sign-on
236
+ (and great documentation).
237
+ - [`fastify-explorer`](https://github.com/Eomm/fastify-explorer) Get control of
238
+ your decorators across all the encapsulated contexts.
239
+ - [`fastify-favicon`](https://github.com/smartiniOnGitHub/fastify-favicon)
240
+ Fastify plugin to serve default favicon.
241
+ - [`fastify-feature-flags`](https://gitlab.com/m03geek/fastify-feature-flags)
242
+ Fastify feature flags plugin with multiple providers support (e.g. env,
243
+ [config](https://lorenwest.github.io/node-config/),
244
+ [unleash](https://unleash.github.io/)).
245
+ - [`fastify-file-routes`](https://github.com/spa5k/fastify-file-routes)
246
+ Get Next.js based file system routing into fastify.
247
+ - [`fastify-file-upload`](https://github.com/huangang/fastify-file-upload)
248
+ Fastify plugin for uploading files.
249
+ - [`fastify-firebase`](https://github.com/now-ims/fastify-firebase) Fastify
250
+ plugin for [Firebase Admin SDK](https://firebase.google.com/docs/admin/setup)
251
+ to Fastify so you can easily use Firebase Auth, Firestore, Cloud Storage,
252
+ Cloud Messaging, and more.
253
+ - [`fastify-firebase-auth`](https://github.com/oxsav/fastify-firebase-auth)
254
+ Firebase Authentication for Fastify supporting all of the methods relating to
255
+ the authentication API.
256
+ - [`fastify-formidable`](https://github.com/climba03003/fastify-formidable)
257
+ Handy plugin to provide multipart support and fastify-swagger integration.
258
+ - [`fastify-gcloud-trace`](https://github.com/mkinoshi/fastify-gcloud-trace)
259
+ [Google Cloud Trace API](https://cloud.google.com/trace/docs/reference)
260
+ Connector for Fastify.
261
+ - [`fastify-get-head`](https://github.com/MetCoder95/fastify-get-head) Small
262
+ plugin to set a new HEAD route handler for each GET route previously
263
+ registered in Fastify.
264
+ - [`fastify-get-only`](https://github.com/DanieleFedeli/fastify-get-only) Small
265
+ plugin used to make fastify accept only GET requests
266
+ - [`fastify-good-sessions`](https://github.com/Phara0h/fastify-good-sessions) A
267
+ good Fastify sessions plugin focused on speed.
268
+ - [`fastify-google-cloud-storage`](https://github.com/carlozamagni/fastify-google-cloud-storage)
269
+ Fastify plugin that exposes a GCP Cloud Storage client instance.
270
+ - [`fastify-grant`](https://github.com/simov/fastify-grant)
271
+ Authentication/Authorization plugin for Fastify that supports 200+ OAuth
272
+ Providers.
273
+ - [`fastify-guard`](https://github.com/hsynlms/fastify-guard) A Fastify plugin
274
+ that protects endpoints by checking authenticated user roles and/or scopes.
275
+ - [`fastify-graceful-shutdown`](https://github.com/hemerajs/fastify-graceful-shutdown)
276
+ Shutdown Fastify gracefully and asynchronously.
277
+ - [`fastify-hasura`](https://github.com/ManUtopiK/fastify-hasura) A Fastify
278
+ plugin to have fun with [Hasura](https://github.com/hasura/graphql-engine).
279
+ - [`fastify-healthcheck`](https://github.com/smartiniOnGitHub/fastify-healthcheck)
280
+ Fastify plugin to serve a health check route and a probe script.
281
+ - [`fastify-hemera`](https://github.com/hemerajs/fastify-hemera) Fastify Hemera
282
+ plugin, for writing reliable & fault-tolerant microservices with
283
+ [nats.io](https://nats.io/).
284
+ - [`fastify-http-context`](https://github.com/thorough-developer/fastify-http-context)
285
+ Fastify plugin for "simulating" a thread of execution to allow for true HTTP
286
+ context to take place per API call within the Fastify lifecycle of calls.
287
+ - [`fastify-http2https`](https://github.com/lolo32/fastify-http2https) Redirect
288
+ HTTP requests to HTTPS, both using the same port number, or different response
289
+ on HTTP and HTTPS.
290
+ - [`fastify-http-client`](https://github.com/kenuyx/fastify-http-client) Plugin
291
+ to send HTTP(s) requests. Built upon
292
+ [urllib](https://github.com/node-modules/urllib).
293
+ - [`fastify-http-errors-enhanced`](https://github.com/ShogunPanda/fastify-http-errors-enhanced)
294
+ An error handling plugin for Fastify that uses enhanced HTTP errors.
295
+ - [`fastify-https-redirect`](https://github.com/tomsvogel/fastify-https-redirect)
296
+ Fastify plugin for auto-redirect from HTTP to HTTPS.
297
+ - [`fastify-influxdb`](https://github.com/alex-ppg/fastify-influxdb) Fastify
298
+ InfluxDB plugin connecting to an InfluxDB instance via the Influx default
299
+ package.
300
+ - [`fastify-jwt-authz`](https://github.com/Ethan-Arrowood/fastify-jwt-authz) JWT
301
+ user scope verifier.
302
+ - [`fastify-jwt-webapp`](https://github.com/charlesread/fastify-jwt-webapp) JWT
303
+ authentication for Fastify-based web apps.
304
+ - [`fastify-knexjs`](https://github.com/chapuletta/fastify-knexjs) Fastify
305
+ plugin for support KnexJS Query Builder.
306
+ - [`fastify-knexjs-mock`](https://github.com/chapuletta/fastify-knexjs-mock)
307
+ Fastify Mock KnexJS for testing support.
308
+ - [`fastify-kubernetes`](https://github.com/greguz/fastify-kubernetes) Fastify
309
+ Kubernetes client plugin.
310
+ - [`fastify-language-parser`](https://github.com/lependu/fastify-language-parser)
311
+ Fastify plugin to parse request language.
312
+ - [`fastify-loader`](https://github.com/TheNoim/fastify-loader) Load routes from
313
+ a directory and inject the Fastify instance in each file.
314
+ - [`fastify-lured`](https://github.com/lependu/fastify-lured) Plugin to load lua
315
+ scripts with [fastify-redis](https://github.com/fastify/fastify-redis) and
316
+ [lured](https://github.com/enobufs/lured).
317
+ - [`fastify-mailer`](https://github.com/coopflow/fastify-mailer) Plugin to
318
+ initialize and encapsulate [Nodemailer](https://nodemailer.com)'s transporters
319
+ instances in Fastify.
320
+ - [`fastify-markdown`](https://github.com/freezestudio/fastify-markdown) Plugin
321
+ to markdown support.
322
+ - [`fastify-method-override`](https://github.com/corsicanec82/fastify-method-override)
323
+ Plugin for Fastify, which allows the use of HTTP verbs, such as DELETE, PATCH,
324
+ HEAD, PUT, OPTIONS in case the client doesn't support them.
325
+ - [`fastify-metrics`](https://gitlab.com/m03geek/fastify-metrics) Plugin for
326
+ exporting [Prometheus](https://prometheus.io) metrics.
327
+ - [`fastify-minify`](https://github.com/Jelenkee/fastify-minify) Plugin for
328
+ minification and transformation of responses.
329
+ - [`fastify-mongo-memory`](https://github.com/chapuletta/fastify-mongo-memory)
330
+ Fastify MongoDB in Memory Plugin for testing support.
331
+ - [`fastify-mongoose-api`](https://github.com/jeka-kiselyov/fastify-mongoose-api)
332
+ Fastify plugin to create REST API methods based on Mongoose MongoDB models.
333
+ - [`fastify-mongoose-driver`](https://github.com/alex-ppg/fastify-mongoose)
334
+ Fastify Mongoose plugin that connects to a MongoDB via the Mongoose plugin
335
+ with support for Models.
336
+ - [`fastify-msgpack`](https://github.com/kenriortega/fastify-msgpack) Fastify
337
+ and MessagePack, together at last. Uses @msgpack/msgpack by default.
338
+ - [`fastify-multer`](https://github.com/fox1t/fastify-multer) Multer is a plugin
339
+ for handling multipart/form-data, which is primarily used for uploading files.
340
+ - [`fastify-nats`](https://github.com/mahmed8003/fastify-nats) Plugin to share
341
+ [NATS](https://nats.io) client across Fastify.
342
+ - [`fastify-no-additional-properties`](https://github.com/greguz/fastify-no-additional-properties)
343
+ Add `additionalProperties: false` by default to your JSON Schemas.
344
+ - [`fastify-no-icon`](https://github.com/jsumners/fastify-no-icon) Plugin to
345
+ eliminate thrown errors for `/favicon.ico` requests.
346
+ - [`fastify-nodemailer`](https://github.com/lependu/fastify-nodemailer) Plugin
347
+ to share [nodemailer](https://nodemailer.com) transporter across Fastify.
348
+ - [`fastify-normalize-request-reply`](https://github.com/ericrglass/fastify-normalize-request-reply)
349
+ Plugin to normalize the request and reply to the Express version 4.x request
350
+ and response, which allows use of middleware, like swagger-stats, that was
351
+ originally written for Express.
352
+ - [`fastify-now`](https://github.com/yonathan06/fastify-now) Structure your
353
+ endpoints in a folder and load them dynamically with Fastify.
354
+ - [`fastify-nuxtjs`](https://github.com/gomah/fastify-nuxtjs) Vue server-side
355
+ rendering support for Fastify with Nuxt.js Framework.
356
+ - [`fastify-oas`](https://gitlab.com/m03geek/fastify-oas) Generates OpenAPI 3.0+
357
+ documentation from routes schemas for Fastify.
358
+ - [`fastify-objectionjs`](https://github.com/jarcodallo/fastify-objectionjs)
359
+ Plugin for the Fastify framework that provides integration with objectionjs
360
+ ORM.
361
+ - [`fastify-objectionjs-classes`](https://github.com/kamikazechaser/fastify-objectionjs-classes)
362
+ Plugin to cherry-pick classes from objectionjs ORM.
363
+ - [`fastify-openapi-docs`](https://github.com/ShogunPanda/fastify-openapi-docs)
364
+ A Fastify plugin that generates OpenAPI spec automatically.
365
+ - [`fastify-openapi-glue`](https://github.com/seriousme/fastify-openapi-glue)
366
+ Glue for OpenAPI specifications in Fastify, autogenerates routes based on an
367
+ OpenAPI Specification.
368
+ - [`fastify-opentelemetry`](https://github.com/autotelic/fastify-opentelemetry)
369
+ A Fastify plugin that uses the [OpenTelemetry
370
+ API](https://github.com/open-telemetry/opentelemetry-js-api) to provide
371
+ request tracing.
372
+ - [`fastify-oracle`](https://github.com/cemremengu/fastify-oracle) Attaches an
373
+ [`oracledb`](https://github.com/oracle/node-oracledb) connection pool to a
374
+ Fastify server instance.
375
+ - [`fastify-orientdb`](https://github.com/mahmed8003/fastify-orientdb) Fastify
376
+ OrientDB connection plugin, with which you can share the OrientDB connection
377
+ across every part of your server.
378
+ - [`fastify-piscina`](https://github.com/piscinajs/fastify-piscina) A worker
379
+ thread pool plugin using [Piscina](https://github.com/piscinajs/piscina).
380
+ - [`fastify-peekaboo`](https://github.com/simone-sanfratello/fastify-peekaboo)
381
+ Fastify plugin for memoize responses by expressive settings.
382
+ - [`fastify-polyglot`](https://github.com/heply/fastify-polyglot) A plugin to
383
+ handle i18n using
384
+ [node-polyglot](https://www.npmjs.com/package/node-polyglot).
385
+ - [`fastify-postgraphile`](https://github.com/alemagio/fastify-postgraphile)
386
+ Plugin to integrate [PostGraphile](https://www.graphile.org/postgraphile/) in
387
+ a Fastify project.
388
+ - [`fastify-prettier`](https://github.com/hsynlms/fastify-prettier) A Fastify
389
+ plugin that uses [prettier](https://github.com/prettier/prettier) under the
390
+ hood to beautify outgoing responses and/or other things in the Fastify server.
391
+ - [`fastify-print-routes`](https://github.com/ShogunPanda/fastify-print-routes)
392
+ A Fastify plugin that prints all available routes.
393
+ - [`fastify-protobufjs`](https://github.com/kenriortega/fastify-protobufjs)
394
+ Fastify and protobufjs, together at last. Uses protobufjs by default.
395
+ - [`fastify-qrcode`](https://github.com/chonla/fastify-qrcode) This plugin
396
+ utilizes [qrcode](https://github.com/soldair/node-qrcode) to generate QR Code.
397
+ - [`fastify-qs`](https://github.com/webdevium/fastify-qs) A plugin for Fastify
398
+ that adds support for parsing URL query parameters with
399
+ [qs](https://github.com/ljharb/qs).
400
+ - [`fastify-raw-body`](https://github.com/Eomm/fastify-raw-body) Add the
401
+ `request.rawBody` field.
402
+ - [`fastify-rbac`](https://gitlab.com/m03geek/fastify-rbac) Fastify role-based
403
+ access control plugin.
404
+ - [`fastify-recaptcha`](https://github.com/qwertyforce/fastify-recaptcha)
405
+ Fastify plugin for recaptcha verification.
406
+ - [`fastify-redis-channels`](https://github.com/hearit-io/fastify-redis-channels)
407
+ A plugin for fast, reliable, and scalable channels implementation based on
408
+ Redis streams.
409
+ - [`fastify-register-routes`](https://github.com/israeleriston/fastify-register-routes)
410
+ Plugin to automatically load routes from a specified path and optionally limit
411
+ loaded file names by a regular expression.
412
+ - [`fastify-response-time`](https://github.com/lolo32/fastify-response-time) Add
413
+ `X-Response-Time` header at each request for Fastify, in milliseconds.
414
+ - [`fastify-response-caching`](https://github.com/codeaholicguy/fastify-response-caching)
415
+ A Fastify plugin for caching the response.
416
+ - [`fastify-resty`](https://github.com/FastifyResty/fastify-resty) Fastify-based
417
+ web framework with REST API routes auto-generation for TypeORM entities using
418
+ DI and decorators.
419
+ - [`fastify-reverse-routes`](https://github.com/dimonnwc3/fastify-reverse-routes)
420
+ Fastify reverse routes plugin, allows to defined named routes and build path
421
+ using name and parameters.
422
+ - [`fastify-rob-config`](https://github.com/jeromemacias/fastify-rob-config)
423
+ Fastify Rob-Config integration.
424
+ - [`fastify-route-group`](https://github.com/TakNePoidet/fastify-route-group)
425
+ Convenient grouping and inheritance of routes
426
+ - [`fastify-schema-constraint`](https://github.com/Eomm/fastify-schema-constraint)
427
+ Choose the JSON schema to use based on request parameters.
428
+ - [`fastify-schema-to-typescript`](https://github.com/thomasthiebaud/fastify-schema-to-typescript)
429
+ Generate typescript types based on your JSON/YAML validation schemas so they
430
+ are always in sync.
431
+ - [`fastify-secure-session`](https://github.com/mcollina/fastify-secure-session)
432
+ Create a secure stateless cookie session for Fastify.
433
+ - [`fastify-sentry`](https://github.com/alex-ppg/fastify-sentry) Fastify plugin
434
+ to add the Sentry SDK error handler to requests.
435
+ - [`fastify-sequelize`](https://github.com/lyquocnam/fastify-sequelize) Fastify
436
+ plugin work with Sequelize (adapter for NodeJS -> Sqlite, Mysql, Mssql,
437
+ Postgres).
438
+ - [`fastify-server-session`](https://github.com/jsumners/fastify-server-session)
439
+ A session plugin with support for arbitrary backing caches via
440
+ `fastify-caching`.
441
+ - [`fastify-slonik`](https://github.com/Unbuttun/fastify-slonik) Fastify Slonik
442
+ plugin, with this you can use slonik in every part of your server.
443
+ - [`fastify-soap-client`](https://github.com/fastify/fastify-soap-client) a SOAP
444
+ client plugin for Fastify.
445
+ - [`fastify-socket.io`](https://github.com/alemagio/fastify-socket.io) a
446
+ Socket.io plugin for Fastify.
447
+ - [`fastify-split-validator`](https://github.com/MetCoder95/fastify-split-validator) Small plugin to allow you use multiple validators in one route based on each HTTP part of the request.
448
+ - [`fastify-sse`](https://github.com/lolo32/fastify-sse) to provide Server-Sent
449
+ Events with `reply.sse( … )` to Fastify.
450
+ - [`fastify-sse-v2`](https://github.com/nodefactoryio/fastify-sse-v2) to provide
451
+ Server-Sent Events using Async Iterators (supports newer versions of Fastify).
452
+ - [`fastify-stripe`](https://github.com/coopflow/fastify-stripe) Plugin to
453
+ initialize and encapsulate [Stripe
454
+ Node.js](https://github.com/stripe/stripe-node) instances in Fastify.
455
+ - [`fastify-supabase`](https://github.com/coopflow/fastify-supabase) Plugin to
456
+ initialize and encapsulate [Supabase](https://github.com/supabase/supabase-js)
457
+ instances in Fastify.
458
+ - [`fastify-tls-keygen`](https://gitlab.com/sebdeckers/fastify-tls-keygen)
459
+ Automatically generate a browser-compatible, trusted, self-signed,
460
+ localhost-only, TLS certificate.
461
+ - [`fastify-tokenize`](https://github.com/Bowser65/fastify-tokenize)
462
+ [Tokenize](https://github.com/Bowser65/Tokenize) plugin for Fastify that
463
+ removes the pain of managing authentication tokens, with built-in integration
464
+ for `fastify-auth`.
465
+ - [`fastify-totp`](https://github.com/heply/fastify-totp) A plugin to handle
466
+ TOTP (e.g. for 2FA).
467
+ - [`fastify-twitch-ebs-tools`](https://github.com/lukemnet/fastify-twitch-ebs-tools)
468
+ Useful functions for Twitch Extension Backend Services (EBS).
469
+ - [`fastify-typeorm-plugin`](https://github.com/inthepocket/fastify-typeorm-plugin)
470
+ Fastify plugin to work with TypeORM.
471
+ - [`fastify-vhost`](https://github.com/patrickpissurno/fastify-vhost) Proxy
472
+ subdomain HTTP requests to another server (useful if you want to point
473
+ multiple subdomains to the same IP address, while running different servers on
474
+ the same machine).
475
+ - [`fastify-vite`](https://github.com/galvez/fastify-vite)
476
+ [Vite](https://vitejs.dev/) plugin for Fastify with SSR data support.
477
+ - [`fastify-vue-plugin`](https://github.com/TheNoim/fastify-vue)
478
+ [Nuxt.js](https://nuxtjs.org) plugin for Fastify. Control the routes nuxt
479
+ should use.
480
+ - [`fastify-wamp-router`](https://github.com/lependu/fastify-wamp-router) Web
481
+ Application Messaging Protocol router for Fastify.
482
+ - [`fast-water`](https://github.com/tswayne/fast-water) A Fastify plugin for
483
+ waterline. Decorates Fastify with waterline models.
484
+ - [`fastify-webpack-hmr`](https://github.com/lependu/fastify-webpack-hmr)
485
+ Webpack hot module reloading plugin for Fastify.
486
+ - [`fastify-ws`](https://github.com/gj/fastify-ws) WebSocket integration for
487
+ Fastify — with support for WebSocket lifecycle hooks instead of a single
488
+ handler function. Built upon [ws](https://github.com/websockets/ws) and
489
+ [uws](https://github.com/uNetworking/uWebSockets).
490
+ - [`fastify-xml-body-parser`](https://github.com/NaturalIntelligence/fastify-xml-body-parser)
491
+ Parse XML payload / request body into JS / JSON object.
492
+ - [`fastify-xray`](https://github.com/jeromemacias/fastify-xray) Fastify plugin
493
+ for AWS XRay recording.
494
+ - [`i18next-http-middleware`](https://github.com/i18next/i18next-http-middleware#fastify-usage)
495
+ An [i18next](https://www.i18next.com) based i18n (internationalization)
496
+ middleware to be used with Node.js web frameworks like Express or Fastify and
497
+ also for Deno.
498
+ - [`k-fastify-gateway`](https://github.com/jkyberneees/fastify-gateway) API
499
+ Gateway plugin for Fastify, a low footprint implementation that uses the
500
+ `fastify-reply-from` HTTP proxy library.
501
+ - [`mercurius`](https://mercurius.dev/) A fully-featured and performant GraphQL
502
+ server implementation for Fastify.
503
+ - [`nstats`](https://github.com/Phara0h/nstats) A fast and compact way to get
504
+ all your network and process stats for your node application. Websocket,
505
+ HTTP/S, and prometheus compatible!
506
+ - [`oas-fastify`](https://github.com/ahmadnassri/node-oas-fastify) OAS 3.x to
507
+ Fastify routes automation. Automatically generates route handlers with fastify
508
+ configuration and validation.
509
+ - [`openapi-validator-middleware`](https://github.com/PayU/openapi-validator-middleware#fastify)
510
+ Swagger and OpenAPI 3.0 spec-based request validation middleware that supports
511
+ Fastify.
512
+ - [`sequelize-fastify`](https://github.com/hsynlms/sequelize-fastify) A simple
513
+ and lightweight Sequelize plugin for Fastify.
@@ -2,9 +2,13 @@
2
2
 
3
3
  ## Fluent Schema
4
4
 
5
- The [Validation and Serialization](Validation-and-Serialization.md) documentation outlines all parameters accepted by Fastify to set up JSON Schema Validation to validate the input, and JSON Schema Serialization to optimize the output.
5
+ The [Validation and
6
+ Serialization](../Reference/Validation-and-Serialization.md) documentation
7
+ outlines all parameters accepted by Fastify to set up JSON Schema Validation to
8
+ validate the input, and JSON Schema Serialization to optimize the output.
6
9
 
7
- [`fluent-json-schema`](https://github.com/fastify/fluent-json-schema) can be used to simplify this task while allowing the reuse of constants.
10
+ [`fluent-json-schema`](https://github.com/fastify/fluent-json-schema) can be
11
+ used to simplify this task while allowing the reuse of constants.
8
12
 
9
13
  ### Basic settings
10
14
 
@@ -51,9 +55,12 @@ fastify.post('/the/url', { schema }, handler)
51
55
 
52
56
  ### Reuse
53
57
 
54
- With `fluent-json-schema` you can manipulate your schemas more easily and programmatically and then reuse them
55
- thanks to the `addSchema()` method. You can refer to the schema in two different manners that are detailed
56
- in the [Validation-and-Serialization.md](Validation-and-Serialization.md#adding-a-shared-schema) documentation.
58
+ With `fluent-json-schema` you can manipulate your schemas more easily and
59
+ programmatically and then reuse them thanks to the `addSchema()` method. You can
60
+ refer to the schema in two different manners that are detailed in the
61
+ [Validation and
62
+ Serialization](../Reference/Validation-and-Serialization.md#adding-a-shared-schema)
63
+ documentation.
57
64
 
58
65
  Here are some usage examples:
59
66
 
@@ -85,7 +92,8 @@ fastify.post('/the/url', { schema }, handler)
85
92
  ```
86
93
 
87
94
 
88
- **`replace-way`**: refer to a shared schema to replace before the validation process.
95
+ **`replace-way`**: refer to a shared schema to replace before the validation
96
+ process.
89
97
 
90
98
  ```js
91
99
  const sharedAddressSchema = {
@@ -114,4 +122,5 @@ const schema = { body: bodyJsonSchema }
114
122
  fastify.post('/the/url', { schema }, handler)
115
123
  ```
116
124
 
117
- NB You can mix up the `$ref-way` and the `replace-way` when using `fastify.addSchema`.
125
+ NB You can mix up the `$ref-way` and the `replace-way` when using
126
+ `fastify.addSchema`.