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

feat: separate fastify app from its server listening mode #1

Merged
merged 1 commit into from
Dec 26, 2022

Conversation

lirantal
Copy link
Owner

This separation, while seamingly artificial, helps to avoid the Fastify app server in the global scope from the server.js file.

It also aids in testing, where only the appFramework can be used to fire up a listener bound to a port, or use Fastify's own route injection capabilities (a la fastify.inject()) in order to completely remove the need for an HTTP request and a client to trigger one.

This separation, while seamingly artificial, helps to avoid
the Fastify app server in the global scope from the server.js
file.

It also aids in testing, where only the `appFramework` can be
used to fire up a listener bound to a port, or use Fastify's
own route injection capabilities (a la `fastify.inject()`)
in order to completely remove the need for an HTTP request
and a client to trigger one.
@lirantal lirantal self-assigned this Dec 26, 2022
@lirantal lirantal merged commit d609d8d into main Dec 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant