GithubHelp home page GithubHelp logo

merver's Introduction

Merver

A simple sequence mock API Server. This is intended to make functional UI tests easier for SPA applications

Merver will serve API endpoints according to a YAML definition. What makes this different than other mock servers, is that you can have sequenced responses for your use cases. For example:

  1. POST /login fails with 403 (assumed bad credentials)
  2. POST /login succeeds the second time with 200 (assumed good credentials)
  3. GET /user/1 gives back a user with name = "Laura Johnson"
  4. PUT /user/1 gives back a user with name = "Laura Raghunath"
  5. GET /user/1 gives back a user with name = "Laura Raghunath"

Example YAML for above:

---
routes:
  "/login":
    POST:
      responses:
      - response:
          message: Invalid Password
        status: 403
      - response:
          id: 1
          name: Laura Johnson
        status: 200
  "/user/1":
    GET:
      response:
        name: Laura Johnson
    PUT:
      response:
        name: Laura Raghunath
      update:
        "/user/1":
          GET:
            response:
              name: Laura Raghunath

GET /_docs

This readme in in markdown

POST /_setup

{
    "YAML":"YAML Definition"
}

POST /_setup/file

{
    "path":"Absolute YAML File Path"
}

GET /_merver

{
    "rawYAML": "Raw YAML Text",
    "definition": {
        // JSON definition
    }
}

merver's People

Contributors

fsmawi avatar stephenthedev avatar

Watchers

 avatar  avatar

Forkers

fsmawi

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.