Skip to content

Quickly run mock API server by configuring the server through YAML

Notifications You must be signed in to change notification settings

kaplanbar/mock-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Mock-server

Mock-server is a lightweight Rust executable to quickly run mock API server where the response body of the API endpoints is defined in the yaml config.

Tech

To run Mock-server locally, you should have

installed on your environment.

Installation

After you have installed Rust and Cargo, clone the repository.

$ git clone https://github.com/kaplanbar/mock-server.git
$ cargo run

Mock API Config

The directory you run the Mock-server should contain a YAML configuration file with a Mockserver prefix in its name.

(Mockserver.example_config.yaml)

---
  host: "0.0.0.0:8080"
  endpoints:
    endpoint1:
      path: "/"
      allowed_methods:
        - GET
        - POST
      response_body:
        quick: "hello"
        brown: 1
    endpoint2:
      path: "/hello"
      allowed_methods:
        - POST
      response_body:
        fox: "post"

Todos

  • Add comments
  • Add more configuration options for endpoints
  • Add details to README

About

Quickly run mock API server by configuring the server through YAML

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages