How to Combine express and gulp

  node.js, question

Recently, I am making a company official website, pure static page, express for server and jade for template engine.

I want to know now, if I need to use some libraries such as bootstrap at the front end, should I use bower to manage it or npm to manage it?

Then if it is used together with gulp, I want to use some plug-ins such as Live-Reload and Wired EP. I don’t know how to combine them.

If only there were relevant examples.

Whether to use bower or npm depends mainly on your packaging strategy. My personal suggestion is that npm is better.

Gulp is not directly related to your express. You didn’t see the essence here clearly. Is there a big difference between using express and php? You can use gulp in express as you use php. It’s just that express is easier to combine and more flexible.

Note that express’s static directory can be configured by itself, so a simple combination

if (app.get('env') === 'development') {
 app.use(express.static(path.join(__dirname, '/public/dev')));
 } else {
 app.use(express.static(path.join(__dirname, '/public/dist')));

The gulp packed code can be put in dist.

Of course, if you want the entire development environment to be integrated, then you need to use gulp and express plug-ins, which I really haven’t done. The plug-in should be this: …