A skeleton Node/Express web server that automagically accepts web-requests on URIs dynamically generated from "plug-and-play" controller modules. A great starting point for RESTful newbs and casual DIY-ers. Inspired by Dan Wahlin's Pluralsight course: Integrating Angular with Node.js RESTful Services.
Here's the trick: read from the .server.config.json file in the home directory to get the location of the controllers dir. Sound too easy? It ain't. BECAUSE, that read not only needs to be done for server initialization (this works fine), it needs to happen beforehand as well, in order to set that location under watch by nodemon.
Currently (cfdef9728f82cd9a961614842173f991ef66d081) npm start will trigger prestart which reads the config fine and sets an npm package config variable to the location. That location is then passed to the nodemon command in npm start. BUT, npm start is getting the PREVIOUS value of that config variable: i.e. after changing the config file's controllerRootDir, you need to start the server twice for nodemon to start watching the new location.
First seen in commit cfdef9728f82cd9a961614842173f991ef66d081 .
Well... this is resolved by fe68873ae60994a4816644eb09ac25d1d05e1d72, with the catch that BASH is now required. I'm closing this bug, but keeping a future enhancement in mind for removing this dependency.
Here's the trick: read from the .server.config.json file in the home directory to get the location of the controllers dir. Sound too easy? It ain't. BECAUSE, that read not only needs to be done for server initialization (this works fine), it needs to happen beforehand as well, in order to set that location under watch by nodemon.
Currently (cfdef9728f82cd9a961614842173f991ef66d081) npm start will trigger prestart which reads the config fine and sets an npm package config variable to the location. That location is then passed to the nodemon command in npm start. BUT, npm start is getting the PREVIOUS value of that config variable: i.e. after changing the config file's controllerRootDir, you need to start the server twice for nodemon to start watching the new location.
First seen in commit cfdef9728f82cd9a961614842173f991ef66d081 .