Replies: 1 comment 1 reply
-
You can write a startup script:
then in any other server file you can put
but I agree it doesn't feel very "solid". I think in an older version there was an "app.js". |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I would like to run some initialization code at server startup. The only advice I have found is to insert it into the
hooks.server.ts
handler. Is there no better way? Ideally we would have some startup handler that all startup initialization code would reside in. For that matter, it would also be helpful to have an idiomatic way of executing server shutdown code.Could someone point me towards any existing best practices that I may have missed? Is there a reason such a feature was never prioritized? Thank you!
Beta Was this translation helpful? Give feedback.
All reactions