Open felikf opened 7 years ago
I would like to serve alternative index file in some circumstaces: ("gulp-webserver": "0.9.1")
"gulp-webserver": "0.9.1"
middleware: function(req, res, next) { if ('/' === req.url) { fs.readFile('index_orig.html', 'utf8', function(err, data) { if (err) throw err; res.send(data); }); } }
But I am getting this error:
C:\Users\felix\project\run-dev.js:36 res.send(data); ^ TypeError: res.send is not a function at C:\Users\felix\project\run-dev.js:36:29 at tryToString (fs.js:456:3) at FSReqWrap.readFileAfterClose [as oncomplete] (fs.js:443:12)
I'm doing the same thing and I'm getting the same issue!
i have also issue
I would like to serve alternative index file in some circumstaces: (
"gulp-webserver": "0.9.1"
)But I am getting this error: