Closed dlarr closed 4 years ago
@dlarr your approach is fine. The only difference is that your server runs earlier then swagger-tools. It means that you can get errors before swagger-tools registers all resources in middleware.
Run your app with debug=swagger*
and you will see what is going on after your server start.
Thanks a lot for input ! :)
Hello,
This is not an issue, but more questioning. I am trying to run unit tests in my tests. Somehow in my tests I need to stop HTTP server. So I am doing this :
Of course it's not working with the example given to start server with the middleware
The Questions are :
Is there a problem doing this OUTSIDE the initializeMiddleware fonction ? (see JS below)
});
const server = app.listen(serverPort); console.log('Your server is listening on port %d (http://localhost:%d)', serverPort, serverPort); console.log('Swagger-ui is available on http://localhost:%d/docs', serverPort); module.exports = server;