Skip to content

Glossary: Building APIs with Node.js

app.inject()

Also written: inject

A Fastify method that hands a request straight to the app and returns the reply, with no network or running server involved. It is used in tests to call an API quickly and check the `statusCode`, `headers` and `json()` of the response.

Where the book teaches it

Related terms

buildAppTest pyramid