Skip to content

Instantly share code, notes, and snippets.

@manolenso
Created March 6, 2014 22:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save manolenso/9400975 to your computer and use it in GitHub Desktop.
Save manolenso/9400975 to your computer and use it in GitHub Desktop.
Gulp server
/*
* Runs a static server on port 3000
**/
gulp.task('serve', function () {
const PORT = 3000;
var fileServer = new (require('node-static')).Server(SITE_DIR);
require('http').createServer(function (request, response) {
request.addListener('end', function () {
fileServer.serve(request, response);
}).resume();
}).listen(PORT);
gutil.log(gutil.colors.blue('HTTP server listening on port', PORT));
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment