Solid Start, how to add backend/nitro plugin?
Lets say I want to have this code initializing when i start/restart the server itself, independent of any clients visiting the webapp?
2 Replies
This is working for me (in prod, keep in mind it won't run for dev servers iirc)
in a file in the
plugins/
direction
https://nitro.build/guide/pluginsPlugins - Nitro
Use plugins to extend Nitro's runtime behavior.
I think code at the top level above the export will run only once at start? Not sure if there's a hook for server start