Mock a server for development and testing
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.circleci
cmd
examples
filesystem
http
json
types
.gitignore
.goreleaser.yml
.tool-versions
LICENSE.md
Makefile
README.md
coffee.png
go.mod
go.sum
localroast_demo.gif
main.go

README.md

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.

[
  {
    "method": "GET",
    "path": "/",
    "status": 200,
    "response": {
        "success": true
    }
  }
]

See examples/stubs.json for more.

Features

  • json input
  • path variable
  • autoload file changes
  • yml input