Async bootstrap via extendExpressApp
#7369
Closed
franky47
started this conversation in
Feature requests
Replies: 2 comments 2 replies
-
I think the pull request #7370 has merit on it's own right, and we'll look at that separately.
I think before we can answer this, we need to understand what kind of startup work you have in mind? Without any additional context, I might ask if you found |
Beta Was this translation helpful? Give feedback.
2 replies
-
This was added in #7370, with an |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I need to run some async tasks when the server starts, and so far the best place I've found to do runtime initialisation is in
extendExpressApp
.Since it's called in an async context, it could be
await
ed increateExpressServer.ts
to allow async operations there:keystone/packages/core/src/lib/server/createExpressServer.ts
Lines 84 to 94 in 81e663d
My question is: does this seem like a good idea, or is there a better place to do this kind of async startup work?
Edit: PR opened: #7370
Beta Was this translation helpful? Give feedback.
All reactions