Skip to content

Instantly share code, notes, and snippets.

@tcarlsen
Created March 27, 2015 10:26
Show Gist options
  • Save tcarlsen/ec8512c7d6cf1f1e4c90 to your computer and use it in GitHub Desktop.
Save tcarlsen/ec8512c7d6cf1f1e4c90 to your computer and use it in GitHub Desktop.
'use strict';
var gulp = require('gulp');
var connect = require('gulp-connect');
var modRewrite = require('connect-modrewrite');
// Rewriting rule for clean urls
var middleware = [
modRewrite([
'!\\.\\w+$ /index.html [L]',
'^/bower_components/(.*) /$1'
])
];
gulp.task('serve', ['watch'], function () {
connect.server({
root: ['src', '.tmp', 'src/assets', 'bower_components'],
port: 8000,
livereload: true,
middleware: function () {
return middleware;
}
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment