I’d still like to try to get an example running w/ Yeoman and Express.
I tried the following and it worked “okay”, but I’m stuck merging the routes. (over simplified for readability)
mkdir test
cd test
express
mkdir app
cd app
mkdir js
cd js
yeoman angular
Then I changed “output:dist” to “output:../../public” in the Gruntfile.js
Now, both servers run okay on their own (e.g. yeoman server and node app.js). I can also run ‘yeoman build’ now to output the minified JS to /public in the express app.
I’m a bit fuzzy on how the routes might merge? I would like / to pull up the Angular route and not the express route, etc. The angular-express-seed examples on github look okay, but I would still like Yeoman integrated into the project.
Any suggestions would be appreciated.
I would recommend this structure for yeoman + expressjs:
So your dir tree should look like this:
You can remove the now redundant
publicdirectory (we’re going to serve fromappinstead):And now in
app.js, you need to change which dir to serve static files from. Change this line:to this:
And that should be about it. There’s one careat in that you now have two “index” files — one in
views/index.jade, and the other inapp/index.html. Removing theapp/index.htmlcurrently breaks yeoman, so my advice is to get rid of the route forapp/index.jadeand just make edits toindex.html.Hope this helps!