grunt-test-server

[![npm](http://img.shields.io/npm/v/grunt-test-server.svg?style=flat-square)](https://www.npmjs.com/package/grunt-test-server) ![npm](http://img.shields.io/npm/l/grunt-test-server.svg?style=flat-square) [![Dependency Status](https://david-dm.org/aliaksand

Usage no npm install needed!

<script type="module">
  import gruntTestServer from 'https://cdn.skypack.dev/grunt-test-server';
</script>

README

npm npm Dependency Status devDependency Status Build Status Coverage Status

grunt-test-server

Powerful grunt task =)

Getting started

To install grunt-test-server from npm, run:

npm install -g grunt-test-server --save

Finally, use the library:


{
   testServerRun: {
      someServer: {
         options: {
            port: 3000,
            serve: function (app) {
               // app - empty express application

               app.get('/hello/world', function (req, res) {
                  req.send({ "hello": "world" });
               });
            }
         }
      }
   },
   
   testServerClose: {
      someServer: {
         options: {
             port: 3000 // need for removing test server
         }
      }
   },
   
   testServerCloseAll: {} // for removing all active test servers
}

// do something helpful

Enjoy!

Support

If you have any problems, you cached a bug, or you have any suggestion - please find an existing issue or create new

Contributing

If you want to develop this library do not be shy - Do that! How to contribute open-source projects

Run tests grunt-test-server

$ npm test