-
-
Notifications
You must be signed in to change notification settings - Fork 797
Closed
Milestone
Description
PR #2255 adds an asyncronous app.setup and service.setup which can be used with new hooks. However, when working with @marshallswain we noticed that this is still not ideal when configuring your application. For example the MongoDB service needs the asynchronous model in the configure function before its setup method is called. We are now looking at adding the following improvements:
app.configureshould allowasyncfunctions. They will run in the orderapp.configureis called and only when the previous function returns. If there is any asynchronousapp.configurefunction,await app.setup()orapp.listen()must be called before any services (callingapp.service(name)) can be used.- As an additional improvement and to avoid having the app in an unexpected state (e.g. in tests), if any service implements a
setupmethod,await app.setup()orapp.listen()must also be called before any services (callingapp.service(name)) can be used.
Both changes will work compatible with existing applications, specifically we wanted to avoid having to unnecessarily call app.setup on client side Feathers apps.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels