grunt-http-server

Integration of http-server to grunt

npm install grunt-http-server
10 downloads in the last day
282 downloads in the last week
742 downloads in the last month

grunt-http-server

Provides static files server integration to Grunt

Donate

Divhide



npm install grunt-http-server

Getting Started

If you need to serve static files in your grunt directory you can add tasks with grunt-http-server.

Just add this task to Gruntfile:



grunt.initConfig({

    'http-server': {

        'dev': {

            // the server root directory
            root: <path>,

            port: 8282,
            // port: function() { return 8282; }

            host: "127.0.0.1",

            cache: <sec>,
            showDir : true,
            autoIndex: true,
            defaultExt: "html",

            // run in parallel with other tasks
            runInBackground: true|false

        }

    }
});

grunt.loadNpmTasks('grunt-http-server');

And run:



grunt http-server:dev

Now your static files are available in http://127.0.0.1:8282/.

More information

http://blog.divhide.com/2013/07/grunt-http-server-npm-js-file-server-on.html

Oscar Brito

npm loves you