The overridden Application#teardown() method in @feathersjs/koa assumes there is a server started and throws a TypeError if there is not one.
If I'm using the app in a migration, a CLI tool, etc. I might not need to start the HTTP server. I'd like to be able to call setup() and then teardown() when I'm done.
Seems to me this worked in v4 with express. Any reason not to add an if (this.server) {} to enable this usage?
Expected behavior
Call app.setup() to initialize the app
Use the app
Call app.teardown() to close out the app
Actual behavior
Calling app.teardown() without first calling app.listen() throws because this.server is undefined
System configuration
Tell us about the applicable parts of your setup.
Module versions (especially the part that's not working):
Steps to reproduce
The overridden
Application#teardown()
method in @feathersjs/koa assumes there is a server started and throws a TypeError if there is not one.If I'm using the app in a migration, a CLI tool, etc. I might not need to start the HTTP server. I'd like to be able to call
setup()
and thenteardown()
when I'm done.Seems to me this worked in v4 with express. Any reason not to add an
if (this.server) {}
to enable this usage?Expected behavior
app.setup()
to initialize the appapp.teardown()
to close out the appActual behavior
app.teardown()
without first callingapp.listen()
throws becausethis.server
is undefinedSystem configuration
Tell us about the applicable parts of your setup.
Module versions (especially the part that's not working):
@feathersjs/koa@5.0.4
NodeJS version:
v18.16.0
Operating System:
macOS 12.6.6
Browser Version:
React Native Version:
Module Loader: