I am trying to push my gulp node app to heroku. In the package.json I have "postinstall": "gulp serveprod" to run a gulp command that starts a webserver.
In package.json
"scripts": {
"start": "node app",
"postinstall": "gulp serveprod",
...etc
}
My gulp task:
gulp.task('serveprod', function() {
connect.server({
root: 'app',
host: '',
port: process.env.PORT,
livereload: false,
open: false
});
});
When I run 'gulp serveprod' in the terminal the app works fine on localhost. However when I run 'gulp push heroku" I get the following that stays until it timesout:
postinstall /tmp/build_c27e9c799bef2671ed033b271feecf87
remote: > gulp serveprod
remote:
remote: [03:54:36] Using gulpfile /tmp/build_c27e9c799bef2671ed033b271feecf87/gulpfile.js
remote: [03:54:36] Starting 'serveprod'...
remote: [03:54:36] Finished 'serveprod' after 12 ms
remote: [03:54:36] Server started http://localhost:8080
My understanding is that the gulp server is using localhost by default and I need to specify the host where heroku will host the app. However I have no idea what to put as 'host'.
I looked at this answer and tried '0.0.0.0' which didn't work. I have also tried http://infinite-lowlands-6023.herokuapp.com/ which is the name of my app which got a similar result, pushing to heroku would just stop at this gulp task. I have followed this question that helped me get through other issues but I am now well and truly stuck on this one.
What do I need to do to deploy this to Heroku successfully? What information needs to go in the 'host' value?
Thanks :)