https://github.com/caalberts/localroast
Mock a server for development and testing
https://github.com/caalberts/localroast
http local-development mock-server stub-server testing-tools
Last synced: 5 days ago
JSON representation
Mock a server for development and testing
- Host: GitHub
- URL: https://github.com/caalberts/localroast
- Owner: caalberts
- License: mit
- Created: 2018-04-11T14:54:10.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2019-11-15T19:25:52.000Z (about 6 years ago)
- Last Synced: 2024-06-20T03:56:55.349Z (over 1 year ago)
- Topics: http, local-development, mock-server, stub-server, testing-tools
- Language: Go
- Homepage:
- Size: 14.3 MB
- Stars: 227
- Watchers: 9
- Forks: 23
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Localroast
[](https://circleci.com/gh/caalberts/localroast/tree/master)
[](https://codecov.io/gh/caalberts/localroast)
[](https://goreportcard.com/report/github.com/caalberts/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.

## Installation
From brew:
```sh
brew install caalberts/tap/localroast
```
From source:
```sh
go get -u github.com/caalberts/localroast
```
## Usage
```sh
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](examples/stubs.json) for more.
## Features
- [x] json input
- [x] path variable
- [x] autoload file changes
- [ ] yml input