walmartlabs/generator-thorax — pull request #120 by trombom (2013-12-21 18:13:36+00:00)
Title: Enhance dev server

- this is the ‘simplest’ solution possible but also the cleanest
- uses express middleware, which can double as a standalone server
when run with, e.g., nodemon
- add grunt noserver and grunt autotest:noserver to make manual server
booting with nodemon easy
- see the server/ directory for implementation
- adds separate jshint config to allow for node style codez

The tl;dr here is that we want a solution that does not change the way
a server is started with grunt, but also provides advanced users the
ability to customize the server to their needs, including the ability
to manually start the server with nodemon

also provides commented out examples of how to customize the server w/ a
database, routes, proxy, etc. but does not currently add those features
beyond the comments provided

Note i played with integrating nodemon directly into the pipeline via
grunt-nodemon and grunt-concurrent but honestly i found a better experience
by booting grunt in one terminal window and nodemon in a second. grunt-concurrent
spits output of concurrent tasks into the same terminal and furthermore
causes race conditions when booting connect/livereload/browser window via
grunt, which although isn’t that big of a deal, it does makes the software
‘feel’ buggy.

Adding support for grunt-concurrent with nodemon may be something we can
further explore in the future, but for now i feel this commit provides a
good ‘middle of the road’ solution that provides power + flexibility

/cc @eastridge

closes #110
closes #112 (nodemon isn’t included by per say, but the added tasks
that don’t boot a server and the server/server.js file
that can act as a server via the if (!module.parent) line
are both aimed at allowing nodemon integration easily)