How to force https (redirect http to https) using gulp-connect on Heroku?
I've already configured SSL on Heroku and my website works great if I prefix https:// before the domain.
gulpfile.js
'use strict';
var gulp = require('gulp');
var $ = require('gulp-load-plugins')();
var history = require('connect-history-api-fallback');
gulp.paths = {
src: 'src',
dist: 'dist',
tmp: '.tmp',
e2e: 'e2e'
};
require('require-dir')('./gulp');
gulp.task('default', ['clean'], function () {
gulp.start('build');
});
gulp.task("serve:production", function(){
$.connect.server({
root: './dist',
port: process.env.PORT || 3004,
middleware: function(connect, opt) {
return [
history({})
]
}
});
});