fastify / fastify-cli

Run a Fastify application with one command!
MIT License
657 stars 163 forks source link

Allow add plugin to main process scope ( not app.js scope ), without eject the project. #653

Open halfong opened 1 year ago

halfong commented 1 year ago

Prerequisites

🚀 Feature Proposal

Say I have a plugin run a headless browser to scrawl things It's better to be a singleton instance through the whole nodejs process scope, not the app scope( for each request ).

For now, I should eject the server.js and add the plugin in it.

Is it possible to add process based plugin without eject ?

Motivation

No response

Example

No response

yazaldefilimone commented 1 year ago

hum, you can explain me more or show exemple for it in code!