https://github.com/hitchclimber/adaptive_rest
Mock REST server that let's you add resources on the fly.
https://github.com/hitchclimber/adaptive_rest
developer-tools mock ratatui rest-api rust tui
Last synced: 5 months ago
JSON representation
Mock REST server that let's you add resources on the fly.
- Host: GitHub
- URL: https://github.com/hitchclimber/adaptive_rest
- Owner: hitchclimber
- License: gpl-2.0
- Created: 2025-12-26T23:10:22.000Z (6 months ago)
- Default Branch: main
- Last Pushed: 2026-01-04T12:08:07.000Z (6 months ago)
- Last Synced: 2026-01-13T22:56:44.495Z (5 months ago)
- Topics: developer-tools, mock, ratatui, rest-api, rust, tui
- Language: Rust
- Homepage:
- Size: 117 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Adaptive Mock REST Server
A simple REST Server based on `actix-web` that lets you add endpoints to test during runtime. While this was mainly for my own educational purposes (learned a ton, btw), I do hope someone might stumble upon this repo and find it useful and/or leave some pointers.
I'm certain there are thousands of other implementations, but I didn't check; sometimes, while playing around on new projects, I just wanted to have a convenient way (preferably via TUI) to change the API on the go.
## Usage
You can configure server address, port and themes via `toml` or `json` files. The program tries to load your configuration file from command line options (`--config`), environment (`ADPTV_CONFIG`) and will finally default to some preset.
On startup, you'll be in `vim`-like `Normal mode`. Following the onscreen instructions you can use these commands to add endpoints:
| Command | Aliases | Description |
|---------|---------|-------------|
| `endpoint add ` | `ep a`, `ep ad`, `ep update`, `ep u`, `ep up` | Add or update an endpoint |
| `endpoint delete ` | `ep d`, `ep del` | Delete an endpoint |
| `endpoint list` | `ep l` | List all endpoints |
| `endpoint allow ` | `ep allow` | Allow an HTTP method on an endpoint |
| `endpoint deny ` | `ep deny` | Deny an HTTP method on an endpoint |
Supported methods: `get`, `post`, `put`, `patch`, `delete` (case insensitive)
In a separate window you can start hitting those endpoints with your app/`curl`.
## TODOs
- [x] config file support
- [ ] `XDG` support for config
- [x] `OPTIONS` method
- [ ] load endpoints from file during runtime