Skip to content

Commit d27d9cc

Browse files
docs: update README
1 parent 46eb14c commit d27d9cc

1 file changed

Lines changed: 0 additions & 29 deletions

File tree

packages/errorHandler/README.md

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,6 @@
22

33
A [Fastify](https://github.com/fastify/fastify) plugin that defines an opinionated config for an API.
44

5-
When registered on a Fastify instance, the plugin will:
6-
7-
* decorate the Fastify instance with the `errorHandler` object, available with the `errorHandler` attribute.
8-
* decorate all requests with the `errorHandler` object, available with the `errorHandler` attribute; this can be used to construct a `buildContext` for mercurius resolvers, for example.
9-
* decorate the Fastify instance with a `hostname` attribute.
10-
115
## Installation
126

137
Install with npm:
@@ -23,26 +17,3 @@ pnpm add --filter "@scope/project @prefabs.tech/fastify-error-handler
2317
```
2418
2519
## Usage
26-
27-
import configPlugin from "@prefabs.tech/fastify-error-handler";
28-
import Fastify from "fastify";
29-
30-
import config from "./config";
31-
32-
const start = async () => {
33-
// Create fastify instance
34-
const fastify = Fastify({
35-
logger: config.logger,
36-
});
37-
38-
// Register fastify-error-handler plugin
39-
await fastify.register(configPlugin, { config });
40-
41-
await fastify.listen({
42-
port: config.port,
43-
host: "0.0.0.0",
44-
});
45-
};
46-
47-
start();
48-
```

0 commit comments

Comments
 (0)