wrap the starting of the server in a startServer method along with another method stopServer that calls app.close() (express method to shut down server). Both of these methods should be exported from server.js
Be sure to start the server if it was executed directly from the cli:
if (require.main === __module__) {
startServer();
}
https://github.com/MVPStudio/mvp-studio-web-cms/blob/master/server/server.js#L44
wrap the starting of the server in a
startServer
method along with another methodstopServer
that callsapp.close()
(express method to shut down server). Both of these methods should be exported from server.jsBe sure to start the server if it was executed directly from the cli: