MVPStudio / mvp-studio-web-cms

the repo for the static site.
https://mvpstudio.github.io/mvp-studio-web-cms/
MIT License
4 stars 0 forks source link

export start/stop server from server.js #40

Open mckelveygreg opened 5 years ago

mckelveygreg commented 5 years ago

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 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();
}