Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/fvhockney/here-boy
Bin for getting api data on your machine for local data mocking
https://github.com/fvhockney/here-boy
Last synced: 22 days ago
JSON representation
Bin for getting api data on your machine for local data mocking
- Host: GitHub
- URL: https://github.com/fvhockney/here-boy
- Owner: fvhockney
- License: mit
- Created: 2020-11-25T19:53:19.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2021-02-14T19:12:33.000Z (almost 4 years ago)
- Last Synced: 2024-10-30T19:46:05.489Z (2 months ago)
- Language: Rust
- Size: 27.3 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Here-Boy!
Download data from API endpoints to individual files to use later. I use this for testing my api liberary integrations against actual data from the api in my test mocks.
Written with [tokio](https://docs.rs/tokio/0.2.23) and [hyper](https://docs.rs/hyper) for blazing fast concurrency.
## Features
- Configure with a toml file or via cli options.
- Cli options will override configuration in the toml.
- Convert toml enpoints entries into json for easy consumption with javaScript mocks
- Concurrency provided by `hyper` and `tokio`
- Receive feedback when an enpoint is unreachable/unusable## Installation
1. Clone the repo
2. `cargo build --release`
3. Make sure the binary is in your path
4. Create your config (must be done manually)
5. Run and enjoy!## Config Reference
```toml
# ./api.tomlbase_uri = "https://your.base.uri"
file_path_prefix = "./path/to/save/data/"
[[endpoints]]
uri = "/endpoint/1"
file = "endpoint_1.json"[[endpoints]]
uri = "/endpoint/2/specific/entry"
file = "endpoint_2_entry.json"
```## Defaults
Default config location: './api.toml'
Default json converstion of config enpoints: './api.json'## Cli Reference
```bash
here-boy 0.1.0USAGE:
here-boy [FLAGS] [OPTIONS]FLAGS:
--convert-config
-h, --help Prints help information
-V, --version Prints version information
-vOPTIONS:
--base-url
-c, --config [default: api.toml]
--converted-config-path [default: api.json]
--dir
```## NB
Paths are dumb. The program makes no attempt to merge your `base-uri` or `file-path-prefix` intelligently. If you leave off or add a `/`, that's on you. (for now)
This program is under development, expect changes.
No tests yet, so probably more than a few rough edges.