Getting Started

Install

npm install mockyeah --save-dev

or

yarn add -D mockyeah

Introductory tutorial

  1. Create an example project and initialized with NPM

    $ mkdir example-app && cd example-app
    $ npm init # all defaults will be fine
    
  2. Install mockyeah

    $ npm install mockyeah --save-dev
    

    or

    $ yarn add -D mockyeah
    
  3. Create script file and add the source below

    $ touch index.js
    
    const mockyeah = require('mockyeah');
    
    mockyeah.get('/hello-world', { text: 'Hello World' });
    
  4. Run the script file with Node

    $ node index.js
    
  5. Open http://localhost:4001/hello-world

  6. Profit. You should see "Hello World" returned from your mock server.

results matching ""

    No results matching ""