Deploy to Heroku Issue
See original GitHub issueI can’t figure out how to deploy gulp-webserver to Heroku. Has anyone tried this? Here is my gulpfile:
var gulp = require('gulp');
var webserver = require('gulp-webserver');
var mainBowerFiles = require('main-bower-files');
var inject = require('gulp-inject');
var del = require('del');
var paths = {
temp: '.tmp',
tempVendor: '.tmp/vendor',
tempIndex: '.tmp/views/index.html',
index: 'app/views/index.html',
appSrc: ['app/**/*', '!app/views/index.html'],
bowerSrc: 'bower_components/**/*',
};
gulp.task('default', ['watch']);
gulp.task('watch', ['serve'], function () {
gulp.watch(paths.appSrc, ['scripts']);
gulp.watch(paths.bowerSrc, ['vendors']);
gulp.watch(paths.index, ['copyAll']);
});
gulp.task('serve', ['copyAll'], function () {
return gulp.src(paths.temp)
.pipe(webserver({
host: '0.0.0.0',
port: '8000',
fallback: 'index.html',
livereload: false,
proxies: [{
source: '/api',
target: 'http://localhost:1337'
}]
}));
});
gulp.task('copyAll', function () {
var tempVendors = gulp.src(mainBowerFiles()).pipe(gulp.dest(paths.tempVendor));
var appFiles = gulp.src(paths.appSrc).pipe(gulp.dest(paths.temp));
return gulp.src(paths.index)
.pipe(gulp.dest(paths.temp))
.pipe(inject(tempVendors, {
relative: true,
name: 'vendorInject'
}))
.pipe(inject(appFiles, {
relative: true
}))
.pipe(gulp.dest(paths.temp));
});
gulp.task('vendors', function () {
var tempVendors = gulp.src(mainBowerFiles()).pipe(gulp.dest(paths.tempVendor));
return gulp.src(paths.tempIndex)
.pipe(inject(tempVendors, {
relative: true,
name: 'vendorInject'
}))
.pipe(gulp.dest(paths.temp));
});
gulp.task('scripts', function () {
var appFiles = gulp.src(paths.appSrc).pipe(gulp.dest(paths.temp));
return gulp.src(paths.tempIndex)
.pipe(inject(appFiles, {
relative: true
}))
.pipe(gulp.dest(paths.temp));
});
gulp.task('clean', function () {
del([paths.temp]);
});
Issue Analytics
- State:
- Created 8 years ago
- Comments:7
Top Results From Across the Web
Troubleshooting Node.js Deploys - Heroku Dev Center
Your Node.js deploy failed - now what? Start with these simple steps to troubleshoot a build issue. Check the buildpack.
Read more >Heroku: Most Common Errors Explained - Papertrail
In this post, we'll discuss in detail three common Heroku errors and explain why these errors happen and how to solve them.
Read more >7. When It Goes Wrong - Heroku: Up and Running [Book]
Deploy Debugging · Check the status site. · Reproduce the problem in another app. · Copy config, add-ons, and labs features. · Check...
Read more >Heroku app successfully deploying, but receiving application ...
Based just on the sample here it looks like you've bound it to a version of python that has a known security issue,...
Read more >3 tricks for solving the `Heroku Application Error` - Medium
After deploying your MongoDB site on Heroku you maybe not expecting this error. photo by Google. Honestly speaking I've also faced this error...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
add host: ‘0.0.0.0’ so it looks like this:
‘use strict’;
/**
dist
folder on a specific port.gulp.task(‘server’, function() { return gulp.src(‘./dist/’).pipe(webserver({ host: ‘0.0.0.0’, port: process.env.PORT || 5000, https: false, open: true })); });
On Tue, Nov 17, 2015 at 9:47 AM, Anthony Hastings notifications@github.com wrote:
That’s done the trick; thank you! It was really trippy that the original author of the ticket was the one who gave me the solution though 😄
Perhaps close this ticket now since you also seem to have sorted it for yourself?
Thanks again, Anthony