Initial documentation of crate.
continuous-integration/drone/push Build is failing Details

This commit is contained in:
Dorian 2024-02-23 21:29:37 -05:00
parent b991c30953
commit 65898987a6
2 changed files with 26 additions and 4 deletions

View File

@ -1,6 +1,7 @@
# mirror-server
A simple server for mirroring HTTP requests for testing.
A simple server for mirroring HTTP requests for testing. It is optimized for
working with REST API JSON calls, and catching headers.
[![Build Status](https://ci.birch-tree.net/api/badges/dorian/mirror-server/status.svg)](https://ci.birch-tree.net/dorian/mirror-server)
@ -14,9 +15,14 @@ A simple server for mirroring HTTP requests for testing.
* Install cargo-deb: `cargo install cargo-deb`
* Create the DEB package: `cargo deb`
* Faster builds using [cargo-watch](https://watchexec.github.io/#cargo-watch): `cargo watch -x run`
* Installing the binary locally from source: `cargo install --path .`
## Install
`mirror-server` is installable either by a local Cargo install or a Debian
package. Additionally `mirror-server` can be run as a Docker container using
the latest (or tagged) release.
### Docker Image
Run via Docker using:
@ -38,7 +44,17 @@ sudo dpkg -i "mirror-server-${VERSION}_amd64.deb"
Afterward you can run using `mirror-server`
## TODO
## Usage
* [ ] Add documentation to the API.
* [ ] Publish crate on <https://crates.io/>.
```bash
> mirror-server --help
A simple server for mirror HTTP requests for testing.
Usage: mirror-server [OPTIONS]
Options:
-p, --port <PORT> Port to run on [default: 8080]
-i, --ips <IPS> Listen to IP mask [default: 0.0.0.0]
-h, --help Print help
-V, --version Print version
```

View File

@ -1,3 +1,9 @@
#![warn(missing_docs)]
#![doc = include_str!("../README.md")]
/// ## Usage
///
use axum::{
extract::{Host, Json, OriginalUri},
http::{header::HeaderMap, Method},