Go mock-server local-development HTTP
Need help with localroast?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.
caalberts

Description

Mock a server for development and testing

215 Stars 20 Forks MIT License 111 Commits 4 Opened issues

Services available

Need anything else?

Localroast

CircleCI codecov Go Report Card

localroast

Overview

Localroast quickly stubs a HTTP server. It takes a JSON file with a list of paths and stub responses. Changes are autoloaded. Use it to develop and test an API client.

localroast demo

Installation

From brew:

brew install caalberts/tap/localroast

From source:

go get -u github.com/caalberts/localroast

Usage

localroast examples/stubs.json

The command takes a single argument, a path to a JSON file. The JSON file must be a JSON array containing endpoint definitions. Each endpoint is represented as a JSON object with keys

method
,
path
,
status
and
response
.
response
can be any valid JSON object.
json
[
  {
    "method": "GET",
    "path": "/",
    "status": 200,
    "response": {
        "success": true
    }
  }
]

See examples/stubs.json for more.

Features

  • [x] json input
  • [x] path variable
  • [x] autoload file changes
  • [ ] yml input

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.