Skip to content

Commit

Permalink
chore: fix links (#49)
Browse files Browse the repository at this point in the history
  • Loading branch information
Eomm authored Jan 4, 2022
1 parent 7c9a1c4 commit 0f69b00
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,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 check the usage section below.

To customize them, see how in the [Fastify official docs](https://www.fastify.io/docs/latest/Server/#ajv).
To customize them, see how in the [Fastify official docs](https://www.fastify.io/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/Server/#schemacontroller).
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).

### Customize the `ajv-formats` plugin

Expand Down Expand Up @@ -174,15 +174,15 @@ app.listen(3000)

### How it works

This module provide a factory function to produce [Validator Compilers](https://www.fastify.io/docs/latest/Server/#validatorcompiler) functions.
This module provide a factory function to produce [Validator Compilers](https://www.fastify.io/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/Server/#ajv)
- the AJV configuration: it is [one per server](https://www.fastify.io/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

0 comments on commit 0f69b00

Please sign in to comment.