https://github.com/ams003010/chimera
Chimera is a fast β‘ Rust-based JSON server π¦ with sorting, filtering, and simulated latencyβperfect for rapid API prototyping!
https://github.com/ams003010/chimera
actix-web api-rest clap-rs cli json-server mockapi rust
Last synced: 10 months ago
JSON representation
Chimera is a fast β‘ Rust-based JSON server π¦ with sorting, filtering, and simulated latencyβperfect for rapid API prototyping!
- Host: GitHub
- URL: https://github.com/ams003010/chimera
- Owner: AMS003010
- License: mit
- Created: 2025-03-23T16:02:55.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2025-04-10T17:52:14.000Z (10 months ago)
- Last Synced: 2025-04-15T03:51:56.746Z (10 months ago)
- Topics: actix-web, api-rest, clap-rs, cli, json-server, mockapi, rust
- Language: Rust
- Homepage: https://ams003010.github.io/Chimera/
- Size: 569 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Chimera - A Fast β‘ & Powerful JSON Server built with Rust π¦
## π± Introduction
Chimera is a blazing-fast, configurable JSON server built with Rust and Actix-web. It allows you to serve JSON files as APIs with sorting, pagination, simulated latency, and route-based retrieval. Ideal for prototyping, mock APIs, or rapid development.
## π Features
- **π Serve JSON as an API** β Load any JSON file and serve it as structured API endpoints.
- **π Route-based Data Retrieval** β Fetch data by route and ID.
- **π Sorting Support** β Sort entries dynamically based on attributes.
- **π Pagination Support** β Limit the number of records per request.
- **π Simulated Latency** β Mimic real-world API delays for better testing.
- **β‘ Ultra-Fast Performance** β Leveraging Rust and Actix-web for speed and efficiency.
- **π οΈ Easy Configuration** β Set up ports, file paths, latency, sorting, and pagination via CLI.
## π¦ Installation
### On Windows
On Powershell (Run as Administer)
```
Invoke-WebRequest -Uri "https://github.com/AMS003010/Chimera/releases/download/v0.2.0/chimera-windows.exe" -OutFile "chimera.exe"
```
On Powershell (non-privileged)
```
.\chimera.exe --path data.json
```
### On Linux and Mac
```
curl -sL $(curl -s https://api.github.com/repos/AMS003010/chimera/releases/latest | jq -r '.assets[] | select(.name | test("chimera.*")) | .browser_download_url') -o chimera
chmod 777 chimera
./chimera --path data.json
```
## ποΈ Usage
### Start the Server
```sh
./chimera --path data.json
```
### Available Options
| Flag | Description |
|-----------------|--------------------------------------------------|
| `--path ` | Path to the JSON file (Required) |
| `--port ` | Specify the server port (Default: 8080) |
| `--latency ` | Simulated latency in milliseconds (Optional) |
| `--sort ` | Sort route data dynamically |
| `--page ` | Paginate GET responses (Default: 0 - No Limit) |
## π‘ API Endpoints
| Method | Endpoint | Description |
| -------- | --------------- | -------------------------------- |
| `GET` | `/ping` | Health check (`Pong π`) |
| `GET` | `/{route}` | Retrieve all data under a route |
| `GET` | `/{route}/{id}` | Retrieve a specific record by ID |
| `POST` | `/{route}` | Add a record under a route |
| `DELETE` | `/{route}` | Delete all records under a route |
| `DELETE` | `/{route}/{id}` | Delete a specific record by ID |
## π Example JSON File (`data.json`)
```json
{
"users": [
{ "id": 1, "name": "Alice", "age": 25 },
{ "id": 2, "name": "Bob", "age": 30 }
],
"posts": [
{ "id": 1, "title": "Rust is amazing!" }
]
}
```
## π Why Chimera?
- **Lightweight & Fast** β Runs efficiently with minimal resource usage.
- **Highly Configurable** β Tailor it to your needs with CLI flags.
- **Built for Developers** β Ideal for testing, prototyping, and mock API creation.
## π License
Chimera is licensed under the MIT License.
---
## π¨βπ» Maintainers
This project is maintained by [@AMS003010](https://github.com/AMS003010).
---
## π License
This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.
---
## π‘ Contributing
Contributions are welcome! Feel free to open an issue or submit a pull request.
---
## π© Contact
For any queries or issues, feel free to reach out via GitHub Issues.
Happy Coding! π