0.1.2 • Published 10 years ago

grunt-apimock v0.1.2

Weekly downloads
2
License
MIT
Repository
github
Last release
10 years ago

grunt-apimock

Grunt wrapper around api-mock node module.

Getting Started

This plugin requires Grunt ~0.4.5

If you haven't used Grunt before, be sure to check out the Getting Started guide, as it explains how to create a Gruntfile as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:

npm install grunt-apimock --save-dev

Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:

grunt.loadNpmTasks('grunt-apimock');

The "apimock" task

Overview

In your project's Gruntfile, add a section named apimock to the data object passed into grunt.initConfig().

grunt.initConfig({
  apimock: {
    options: {
      // Task-specific options go here.
    }
  },
});

Options

options.port

Type: Integer Default value: 3000

An integer value that is used to open the apimock server.

options.src

Type: String Default value: ./api/api.apib

A string value that represents the path to the API Blueprint file.

Usage Examples

Default Options

In this example, the default options are used to start an apimock server.

grunt.initConfig({
  apimock: {
    options: {}
  },
});

Custom Options

In this example, custom options are used to start the api-mock server in port 1235 with another_api.apib as source.

grunt.initConfig({
  apimock: {
    options: {
      port: 3000,
      src: './api/another_api.apib',
    }
  },
});

Contributing

In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using Grunt.

Release History

v0.1.0 - Initial release

0.1.2

10 years ago

0.1.1

10 years ago

0.1.0

10 years ago