Nodemon - "clean exit - waiting for changes before restart" during setup
I am also wondering about this statement logged by nodemon. I experienced this only the last days. I get this error if some syntax error exists in my express server code. When I start the server via
> node server
the server does not start and even does not log anything to console. Strange behaviour I think. It seems that this message has nothing to do with nodemon. I never experienced such a thing with node in the past. Every time a syntax error was introduced I got an error message with the stack trace outputted to console.
As I said before it was just a syntax error: A closing bracket was missing from a .then block.
After all I do not know why node was not printing the stack trace as I have experienced it before.
I investigate further but one thing to learn from this kind of error is probably to use a linter for writing javascript code or go a step further and use TypeScript. I use TypeScript for developing the client with Angular and the possibilities to detect syntax errors early are great.
There are a few things wrong with your code. You never told your app to run. When you're ready creating your routes you should start your server with:
app.listen(<port on which the server should run here>);
Also you have an Express app and a router in the same file. The router should only be used as a sub module (handy when you want to divide your app over multiple files). Right now you're doing nothing with it. If you remove the router and the export then it should work fine.