Reputation:
I am wondering how I should structure the front-end of my Express.js project.
I haven't done much with Grunt before, but I understand that it performs tasks such as compiling, and then saves the result.
Currently, my Express.js project looks like this:
/app
/models
/controllers
/views
/config
/public
Any files inside of /public
are static and served as such by the Node app. So, do I initialise Yeoman/Brunt inside of here, or should I store my source outside of the document root, and instead just have it compile to /public
? If so, where would you recommend the source?
Upvotes: 3
Views: 1681
Reputation:
The Yeoman team have setup an express dedicated project which answers this question in the form of back-end generators.
Upvotes: 1
Reputation: 1960
If you will init brunch project, it’s recommended to do it outside public
dir and make it compile stuff to public
dir. You can integrate brunch with express: start your express server with brunch watch --server
quite simply: https://github.com/brunch/brunch/issues/453
Upvotes: 3