Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using Yeoman/Brunch/Grunt inside of an Express.js project

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?


2 Answers

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

like image 77
Paul Miller Avatar answered Nov 27 '25 06:11

Paul Miller


The Yeoman team have setup an express dedicated project which answers this question in the form of back-end generators.


Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!