Skip to content

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

Merged
lirantal merged 1 commit intomainfrom
feat/app-and-server-isolated
Dec 26, 2022
Merged

feat: separate fastify app from its server listening mode#1
lirantal merged 1 commit intomainfrom
feat/app-and-server-isolated

Conversation

@lirantal
Copy link
Copy Markdown
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