Skip to content

adalyte/mocki

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
src
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Mocki

npm version Coverage Status

Mocki is a tool that lets you create Mock REST and GraphQL APIs.

Support for

  • Simulated failures
  • Simulated delays
  • Randomized reponses
  • Conditional resposes
  • Fake data generation

Getting Started

  1. Install Mocki npm install -g mocki

  2. Create a config YAML-file using the structure in .mocki/config.yml

    Hello world example:

     name: mocki
     port: 3000
     endpoints:
       - path: /hello
         method: get
           responses:
             - statusCode: 200
               body:
                 message: Hello from Mocki!
    
  3. Start your mock by running mocki run --path ./path/to/config.yml

  4. Test your mock by running curl http://localhost:3000

    { "message": "Hello World!" }
    

Prerequisites

We recommend using nvm to manage Node versions

  • npm > 6
  • node > 12

Documentation

Documentation is available at Mocki.io

Publishing a new version

  1. Create tag from latest commit: git tag vX.Y.Z
  2. Push tag: git push origin vX.Y.Z
  3. Publish to npm: npm publish
  4. Update coverage report: npm run coverage

About

Mock your APIs at scale using Mocki πŸ¦…

Resources

Stars

Watchers

Forks

Packages

No packages published