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

docs(readme): replace fastify.io links with fastify.dev #115

Merged
merged 1 commit into from
Jan 13, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,13 @@ The Fastify's default [`ajv` options](https://github.com/ajv-validator/ajv/tree/
Moreover, the [`ajv-formats`](https://www.npmjs.com/package/ajv-formats) module is included by default.
If you need to customize it, check the _usage_ section below.

To customize the `ajv`'s options, see how in the [Fastify official docs](https://www.fastify.io/docs/latest/Reference/Server/#ajv).
To customize the `ajv`'s options, see how in the [Fastify official docs](https://www.fastify.dev/docs/latest/Reference/Server/#ajv).


## Usage

This module is already used as default by Fastify.
If you need to provide to your server instance a different version, refer to [the official doc](https://www.fastify.io/docs/latest/Reference/Server/#schemacontroller).
If you need to provide to your server instance a different version, refer to [the official doc](https://www.fastify.dev/docs/latest/Reference/Server/#schemacontroller).

### Customize the `ajv-formats` plugin

Expand Down Expand Up @@ -203,15 +203,15 @@ app.listen({ port: 3000 })

### How it works

This module provide a factory function to produce [Validator Compilers](https://www.fastify.io/docs/latest/Reference/Server/#validatorcompiler) functions.
This module provide a factory function to produce [Validator Compilers](https://www.fastify.dev/docs/latest/Reference/Server/#validatorcompiler) functions.

The Fastify factory function is just one per server instance and it is called for every encapsulated context created by the application through the `fastify.register()` call.

Every Validator Compiler produced, has a dedicated AJV instance, so, this factory will try to produce as less as possible AJV instances to reduce the memory footprint and the startup time.

The variables involved to choose if a Validator Compiler can be reused are:

- the AJV configuration: it is [one per server](https://www.fastify.io/docs/latest/Reference/Server/#ajv)
- the AJV configuration: it is [one per server](https://www.fastify.dev/docs/latest/Reference/Server/#ajv)
- the external JSON schemas: once a new schema is added to a fastify's context, calling `fastify.addSchema()`, it will cause a new AJV inizialization


Expand Down
Loading