Server Start or Init functions
I plan to deploy via docker on our own infra (aws) and I'd like to run some setup script which loads secrets from a vault before the server actually starts (in next.js I used the instrumentation.ts file) - what would be the equivalent or best practice for this in "Start"?
2 Replies
other-emerald•4w ago
you can create a
nitro.config.ts
file at the root of your project with this content
and a plugins/startup.ts
file with this content
watch out though: it's NOT blocking, it runs in parallel to the server starting, not before.
currently i dont think there is any way to run something before the server startsrare-sapphireOP•4w ago
thanks @notKamui - I'll try it out.