mirror of
https://github.com/LukeHagar/arbiter.git
synced 2025-12-09 20:37:50 +00:00
updating docs
This commit is contained in:
BIN
ArbiterLogo.png
Normal file
BIN
ArbiterLogo.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.5 MiB |
@@ -15,7 +15,7 @@ COPY . .
|
|||||||
RUN npm run build
|
RUN npm run build
|
||||||
|
|
||||||
# Expose ports for proxy and docs servers
|
# Expose ports for proxy and docs servers
|
||||||
EXPOSE 3000 3001
|
EXPOSE 8080 9000
|
||||||
|
|
||||||
# Set default command
|
# Set default command
|
||||||
CMD ["node", "dist/src/cli.js"]
|
CMD ["node", "dist/src/cli.js"]
|
||||||
40
README.md
40
README.md
@@ -1,3 +1,7 @@
|
|||||||
|
<p align="center">
|
||||||
|
<img src="ArbiterLogo.png" alt="Arbiter Logo" width="250">
|
||||||
|
</p>
|
||||||
|
|
||||||
# Arbiter
|
# Arbiter
|
||||||
|
|
||||||
Arbiter is a powerful API proxy and documentation generator that automatically creates OpenAPI specifications and HAR (HTTP Archive) recordings for any API you access through it.
|
Arbiter is a powerful API proxy and documentation generator that automatically creates OpenAPI specifications and HAR (HTTP Archive) recordings for any API you access through it.
|
||||||
@@ -26,19 +30,19 @@ npm install -g arbiter
|
|||||||
Start Arbiter by pointing it to your target API:
|
Start Arbiter by pointing it to your target API:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
arbiter --target https://api.example.com --proxy-port 3000 --docs-port 3001
|
arbiter --target https://api.example.com
|
||||||
```
|
```
|
||||||
|
|
||||||
Then send requests through the proxy:
|
Then send requests through the proxy:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
curl http://localhost:3000/users
|
curl http://localhost:8080/users
|
||||||
```
|
```
|
||||||
|
|
||||||
And view the automatically generated documentation:
|
And view the automatically generated documentation:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
open http://localhost:3001/docs
|
open http://localhost:9000/docs
|
||||||
```
|
```
|
||||||
|
|
||||||
### Docker Usage
|
### Docker Usage
|
||||||
@@ -50,20 +54,20 @@ You can run Arbiter using Docker:
|
|||||||
docker build -t arbiter .
|
docker build -t arbiter .
|
||||||
|
|
||||||
# Run the container
|
# Run the container
|
||||||
docker run -p 3000:3000 -p 3001:3001 arbiter --target https://api.example.com
|
docker run -p 8080:8080 -p 9000:9000 arbiter --target https://api.example.com
|
||||||
```
|
```
|
||||||
|
|
||||||
The container exposes:
|
The container exposes:
|
||||||
- Port 3000 for the proxy server
|
- Port 8080 for the proxy server
|
||||||
- Port 3001 for the documentation server
|
- Port 9000 for the documentation server
|
||||||
|
|
||||||
You can customize the ports and other options:
|
You can customize the ports and other options:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
docker run -p 8080:8080 -p 8081:8081 arbiter \
|
docker run -p 3000:3000 -p 3001:3001 arbiter \
|
||||||
--target https://api.example.com \
|
--target https://api.example.com \
|
||||||
--proxy-port 8080 \
|
--port 3000 \
|
||||||
--docs-port 8081 \
|
--docs-port 3001 \
|
||||||
--verbose
|
--verbose
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -71,19 +75,21 @@ docker run -p 8080:8080 -p 8081:8081 arbiter \
|
|||||||
|
|
||||||
| Option | Description | Default |
|
| Option | Description | Default |
|
||||||
|--------|-------------|---------|
|
|--------|-------------|---------|
|
||||||
| `--target` | Target API URL | (required) |
|
| `-t, --target <url>` | Target API URL to proxy to | (required) |
|
||||||
| `--proxy-port` | Port for the proxy server | 3000 |
|
| `-p, --port <number>` | Port to run the proxy server on | 8080 |
|
||||||
| `--docs-port` | Port for the documentation server | 3001 |
|
| `-d, --docs-port <number>` | Port to run the documentation server on | 9000 |
|
||||||
| `--verbose` | Enable verbose logging | false |
|
| `--docs-only` | Run only the documentation server | false |
|
||||||
|
| `--proxy-only` | Run only the proxy server | false |
|
||||||
|
| `-v, --verbose` | Enable verbose logging | false |
|
||||||
|
|
||||||
## API Documentation
|
## API Documentation
|
||||||
|
|
||||||
After using the API through the proxy, you can access:
|
After using the API through the proxy, you can access:
|
||||||
|
|
||||||
- Interactive API docs: `http://localhost:3001/docs`
|
- Interactive API docs: `http://localhost:9000/docs`
|
||||||
- OpenAPI JSON: `http://localhost:3001/openapi.json`
|
- OpenAPI JSON: `http://localhost:9000/openapi.json`
|
||||||
- OpenAPI YAML: `http://localhost:3001/openapi.yaml`
|
- OpenAPI YAML: `http://localhost:9000/openapi.yaml`
|
||||||
- HAR Export: `http://localhost:3001/har`
|
- HAR Export: `http://localhost:9000/har`
|
||||||
|
|
||||||
## How It Works
|
## How It Works
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user