Answer the question
In order to leave comments, you need to log in
How to do reload in express Node.js using Gulp?
var express = require("express");
var app = express();
app.get("/", function(request, response){
response.send("<h2>Привет Express!</h2>");
});
app.listen(3000);
Answer the question
In order to leave comments, you need to log in
Example, change for yourself.
...
const exec = require('child_process').exec;
...
const paths = {
allSrcJs: 'src/**/*.js',
libDir: 'lib',
};
gulp.task('main', gulp.series('build', (callback) => {
exec(`node ${paths.libDir}`, (error, stdout) => {
console.log(stdout);
return callback(error);
});
}));
gulp.task('watch', () => {
gulp.watch(paths.allSrcJs, ['main']);
});
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question