Last active
August 22, 2016 10:04
-
-
Save anuraaga/b25cde3f08675ced5f567fe290de5838 to your computer and use it in GitHub Desktop.
Gulp config for serving a static directory with clean URLs.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"use strict"; | |
var gulp = require('gulp') | |
, modRewrite = require('connect-modrewrite') | |
, connect = require('gulp-connect'); | |
gulp.task('connect', function () { | |
connect.server({ | |
name: 'Test', | |
root: ['dist'], | |
port: 8080, | |
middleware: function () { | |
return [ | |
modRewrite([ | |
'^/$ /index.html [L]', | |
'^/static/.* - [L]', | |
'^(.*)$ $1.html' | |
]) | |
] | |
} | |
}) | |
}); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment