Awesome Open Source
Awesome Open Source

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

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

Get A Weekly Email With Trending Projects For These Topics
No Spam. Unsubscribe easily at any time.
go (14,212
http (885
testing-tools (195
mock-server (46
local-development (20

Find Open Source By Browsing 7,000 Topics Across 59 Categories