All Projects → Ananto30 → gmocker

Ananto30 / gmocker

Licence: MIT License
Create a blazing fast mock server with just a JSON file

Programming Languages

go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to gmocker

kb-proxy
kb-proxy 是一个可本地部署的、提供代理功能、接口测试管理、支持在线Mock、Host环境管理的在线工具平台。
Stars: ✭ 52 (+6.12%)
Mutual labels:  mock-server
json-server
Create a dummy REST API from a json file with zero coding in seconds
Stars: ✭ 34 (-30.61%)
Mutual labels:  mock-server
pytest-mock-server
Mock server plugin for pytest
Stars: ✭ 19 (-61.22%)
Mutual labels:  mock-server
fastglue
Fastglue is an opinionated, bare bones wrapper that glues together fasthttp and fasthttprouter to act as a micro HTTP framework.
Stars: ✭ 71 (+44.9%)
Mutual labels:  fasthttp
heartbeat
A service to keep a live heartbeat (ping) on multiple devices
Stars: ✭ 27 (-44.9%)
Mutual labels:  fasthttp
rusqbin
A server that stashes your requests for later retrieval so you can do end-to-end testing of code that makes HTTP calls. Available as a binary, a Docker image, and a library.
Stars: ✭ 25 (-48.98%)
Mutual labels:  mock-server
chuck
Lightweight proxy for REST API mocking and run integration test on mobile devices
Stars: ✭ 17 (-65.31%)
Mutual labels:  mock-server
rester
Fast and concise RESTful web framework based on fasthttp
Stars: ✭ 27 (-44.9%)
Mutual labels:  fasthttp
mock-json-server
A mock web server using a JSON file with live-reload support.
Stars: ✭ 31 (-36.73%)
Mutual labels:  mock-server
Mockaco
🐵 HTTP mock server, useful to stub services and simulate dynamic API responses, leveraging ASP.NET Core features, built-in fake data generation and pure C# scripting
Stars: ✭ 213 (+334.69%)
Mutual labels:  mock-server
vcr.js
Mock server with Proxy and Record support inspired by ruby VCR.
Stars: ✭ 41 (-16.33%)
Mutual labels:  mock-server
goroutine-pool
A simple goroutine pool which can create and release goroutine dynamically, inspired by fasthttp.
Stars: ✭ 31 (-36.73%)
Mutual labels:  fasthttp
go-movies
golang spider Crawler 爬虫 电影
Stars: ✭ 168 (+242.86%)
Mutual labels:  fasthttp
karate
Test Automation Made Simple
Stars: ✭ 6,384 (+12928.57%)
Mutual labels:  mock-server
any-mock
A configurable mock server,help you mock APIs.
Stars: ✭ 25 (-48.98%)
Mutual labels:  mock-server
main
Mocks Server monorepo
Stars: ✭ 109 (+122.45%)
Mutual labels:  mock-server
mock-algolia
A mock server for the Algolia search engine allowing integration testing without the need to hit Algolia's actual servers
Stars: ✭ 18 (-63.27%)
Mutual labels:  mock-server
mockify
Easy, configurable API mocking you can change on-the-fly
Stars: ✭ 83 (+69.39%)
Mutual labels:  mock-server
pactum
REST API Testing Tool for all levels in a Test Pyramid
Stars: ✭ 190 (+287.76%)
Mutual labels:  mock-server
open-api-mocker
A mock server based in OpenAPI Specification
Stars: ✭ 58 (+18.37%)
Mutual labels:  mock-server

Gmocker

codecov Maintainability Go Report Card

Run a blazing fast mock server in just seconds! 🚀

All you need is to make a json file that contains path and response mapping. See an example here.

Only json is supported for now, please create issues for bugs and new features.

Run

With defaults -

./mocker

Defaults: addr=localhost:7070 , file=mock.json

With custom flags -

./mocker -addr <YOUR_HOST_AND_PORT> -file <MOCK_JSON_FILE_LOCATION>

For windows -

mocker.exe -addr <YOUR_HOST_AND_PORT> -file <MOCK_JSON_FILE_LOCATION>

Sample mock.json file

{
  "<YOUR_PATH>": {
    "statusCode": <INTEGER>,
    "responseBody": {
      <YOUR_RESPONSE_BODY> ...
    }
  }
}

These paths will be matched and the json will be sent.

Example -

{
  "/hello/worlds": {
    "statusCode": 200,
    "responseBody": {
      "message": "Hello worlds!",
      "data" : {
        "time": "now"
      },
      "worlds": [
        "cross origin world",
        "mars world",
        "moon world"
      ]
    }
  }
}

If a request lands in the server in path /hello/worlds the json object inside responseBody will be sent as response.

The request type [POST or GET] doesn't matter.

Build

For mac/linux -

go mod download
go build

For windows -

go mod download
GOOS=windows GOARCH=amd64 go build 

**If the build/binary doesn't work for you, you can do this -

  • Check your os and arch using this command - go env GOOS GOARCH
  • Use the output os and arch to build the binary - GOOS=<YOUR_OS> GOARCH=<YOUR_ARCH> go build
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].