Skip to content

Instantly share code, notes, and snippets.

@romaricpascal
Created May 14, 2013 16:05
Show Gist options
  • Save romaricpascal/5577154 to your computer and use it in GitHub Desktop.
Save romaricpascal/5577154 to your computer and use it in GitHub Desktop.
Sample configuration of the grunt-contrib-connect plugin for Grunt
module.exports = function(grunt) {
// Load Grunt tasks declared in the package.json file
require('matchdep').filterDev('grunt-*').forEach(grunt.loadNpmTasks);
// Configure Grunt
grunt.initConfig({
// grunt-contrib-connect will serve the files of the project
// on specified port and hostname
connect: {
all: {
options:{
port: 9000,
hostname: "0.0.0.0",
// Prevents Grunt to close just after the task (starting the server) completes
// This will be removed later as `watch` will take care of that
keepalive: true
}
}
}
});
// Creates the `server` task
grunt.registerTask('server',[
'connect'
]);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment