Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Starting api-mock from Gulp #21

Open
skawaguchi opened this issue Nov 20, 2014 · 1 comment
Open

Starting api-mock from Gulp #21

skawaguchi opened this issue Nov 20, 2014 · 1 comment

Comments

@skawaguchi
Copy link

Is it possible to start api-mock from Gulp? It tried this, but it didn't work:

gulp.task ( 'api-mock-server', function () {

    var mockServer = new ApiMock ( {
      blueprintPath: './path/to/my/blueprint.md',
      options: {
        port: 5557
      }
    } );

    mockServer.run();

});

When I run this, it's all good:

api-mock ./path/to/my/blueprint.md --port 5557
@danivaan
Copy link

This worked for me

var gulp = require('gulp');
var ApiMock = require('api-mock');

gulp.task ( 'api-mock', function () {

    var mockServer = new ApiMock ( {
      blueprintPath: '../path/to/my/blueprint.md',
      options: {
        port: 5557
      }
    } );

    mockServer.run();

});

And here's my package.json

{
  "name": "project",
  "version": "0.0.0",
  "engines": {
    "node": ">=0.10.0"
  },
  "devDependencies": {
    "api-mock": "~0.1.1",
    "gulp": "~3.8.11"
  }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants