grunt-apimock
v0.1.2
Published
Grunt wrapper for api-mock
Downloads
5
Readme
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