Skip to content

Instantly share code, notes, and snippets.

@chrisvanpatten
Last active June 19, 2017 01:35
Show Gist options
  • Save chrisvanpatten/c17c3ee28a0064210c9ac5bc9bc29839 to your computer and use it in GitHub Desktop.
Save chrisvanpatten/c17c3ee28a0064210c9ac5bc9bc29839 to your computer and use it in GitHub Desktop.
Ignore .html extension in local gulp-connect server
var gulp = require('gulp')
var connect = require('gulp-connect')
var connectRewrite = require('connect-modrewrite')
/**
* Serve requests
*/
gulp.task('serve', function () {
connect.server({
root: 'public',
livereload: true,
port: 8004,
middleware: function () {
return [
connectRewrite([
'^.([^\\.]+)$ /$1.html [L]',
])
]
},
})
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment