Skip to content

Commit 0982e59

Browse files
authored
Merge pull request #10 from jsr-probitas/docs/update-api-documentation
docs: Update API documentation with missing endpoints and port info
2 parents 9a9a199 + a308eb0 commit 0982e59

4 files changed

Lines changed: 481 additions & 46 deletions

File tree

echo-graphql/docs/api.md

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
# echo-graphql API Reference
22

3+
## Base URL
4+
5+
| Environment | URL |
6+
| -------------- | ------------------------ |
7+
| Container | `http://localhost:8080` |
8+
| Docker Compose | `http://localhost:14000` |
9+
10+
> **Note:** The container listens on port 8080. When using `docker compose up`, the
11+
> port is mapped to 14000 on the host.
12+
313
## Endpoints
414

515
| Path | Description |
@@ -122,7 +132,7 @@ query {
122132
**curl:**
123133

124134
```bash
125-
curl -X POST http://localhost:8080/graphql \
135+
curl -X POST http://localhost:14000/graphql \
126136
-H "Content-Type: application/json" \
127137
-d '{"query": "{ echo(message: \"hello\") }"}'
128138
```
@@ -145,7 +155,7 @@ query {
145155
**curl:**
146156

147157
```bash
148-
curl -X POST http://localhost:8080/graphql \
158+
curl -X POST http://localhost:14000/graphql \
149159
-H "Content-Type: application/json" \
150160
-d '{"query": "{ echoWithDelay(message: \"hello\", delayMs: 5000) }"}'
151161
```
@@ -269,7 +279,7 @@ query {
269279
**curl:**
270280

271281
```bash
272-
curl -X POST http://localhost:8080/graphql \
282+
curl -X POST http://localhost:14000/graphql \
273283
-H "Content-Type: application/json" \
274284
-H "Authorization: Bearer token123" \
275285
-d '{"query": "{ echoHeaders { authorization contentType all { name value } } }"}'
@@ -426,7 +436,7 @@ mutation {
426436
**curl:**
427437

428438
```bash
429-
curl -X POST http://localhost:8080/graphql \
439+
curl -X POST http://localhost:14000/graphql \
430440
-H "Content-Type: application/json" \
431441
-d '{"query": "mutation { createMessage(text: \"Hello\") { id text createdAt } }"}'
432442
```
@@ -513,7 +523,7 @@ mutation {
513523

514524
## Subscriptions
515525

516-
Subscriptions use WebSocket protocol. Connect to `ws://localhost:8080/graphql`.
526+
Subscriptions use WebSocket protocol. Connect to `ws://localhost:14000/graphql`.
517527

518528
### messageCreated
519529

@@ -533,7 +543,7 @@ subscription {
533543

534544
```bash
535545
echo '{"type":"start","id":"1","payload":{"query":"subscription { messageCreated { id text } }"}}' | \
536-
websocat ws://localhost:8080/graphql -n
546+
websocat ws://localhost:14000/graphql -n
537547
```
538548

539549
### countdown
@@ -616,7 +626,7 @@ query {
616626
**curl:**
617627

618628
```bash
619-
curl -X POST http://localhost:8080/graphql \
629+
curl -X POST http://localhost:14000/graphql \
620630
-H "Content-Type: application/json" \
621631
-d '{"query": "{ __schema { types { name } } }"}'
622632
```
@@ -660,7 +670,7 @@ GraphQL allows partial success. Some fields may return data while others return
660670
## Health Check
661671

662672
```bash
663-
curl http://localhost:8080/health
673+
curl http://localhost:14000/health
664674
```
665675

666676
**Response:**

echo-grpc/docs/api.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
# echo-grpc API Reference
22

3+
## Base URL
4+
5+
| Environment | Address |
6+
| -------------- | ----------------- |
7+
| Container | `localhost:50051` |
8+
| Docker Compose | `localhost:50051` |
9+
10+
> **Note:** The container listens on port 50051. The same port is exposed
11+
> when using `docker compose up`.
12+
313
## Services
414

515
### Echo Service (echo.v1.Echo)

echo-http/README.md

Lines changed: 35 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -36,15 +36,15 @@ docker run -p 8080:8080 -v $(pwd)/.env:/app/.env ghcr.io/jsr-probitas/echo-http:
3636

3737
### Echo Endpoints
3838

39-
| Endpoint | Method | Description |
40-
| ------------ | ------ | ----------------------------------------- |
41-
| `/get` | GET | Echo request info (query params, headers) |
42-
| `/post` | POST | Echo request body (JSON, form data) |
43-
| `/put` | PUT | Echo request body |
44-
| `/patch` | PATCH | Echo request body |
45-
| `/delete` | DELETE | Echo request info |
46-
| `/anything` | ANY | Echo any request (method, headers, body) |
47-
| `/anything/*`| ANY | Echo any request with path |
39+
| Endpoint | Method | Description |
40+
| ------------- | ------ | ----------------------------------------- |
41+
| `/get` | GET | Echo request info (query params, headers) |
42+
| `/post` | POST | Echo request body (JSON, form data) |
43+
| `/put` | PUT | Echo request body |
44+
| `/patch` | PATCH | Echo request body |
45+
| `/delete` | DELETE | Echo request info |
46+
| `/anything` | ANY | Echo any request (method, headers, body) |
47+
| `/anything/*` | ANY | Echo any request with path |
4848

4949
### Utility Endpoints
5050

@@ -59,44 +59,44 @@ docker run -p 8080:8080 -v $(pwd)/.env:/app/.env ghcr.io/jsr-probitas/echo-http:
5959

6060
### Redirect Endpoints
6161

62-
| Endpoint | Method | Description |
63-
| ---------------------- | ------ | ------------------------------------- |
64-
| `/redirect/{n}` | GET | Redirect n times before final response|
65-
| `/redirect-to` | GET | Redirect to URL (?url=...&status_code=)|
66-
| `/absolute-redirect/{n}`| GET | Redirect n times with absolute URLs |
67-
| `/relative-redirect/{n}`| GET | Redirect n times with relative URLs |
62+
| Endpoint | Method | Description |
63+
| ------------------------ | ------ | --------------------------------------- |
64+
| `/redirect/{n}` | GET | Redirect n times before final response |
65+
| `/redirect-to` | GET | Redirect to URL (?url=...&status_code=) |
66+
| `/absolute-redirect/{n}` | GET | Redirect n times with absolute URLs |
67+
| `/relative-redirect/{n}` | GET | Redirect n times with relative URLs |
6868

6969
### Authentication Endpoints
7070

71-
| Endpoint | Method | Description |
72-
| ---------------------------- | ------ | ---------------------------------------- |
73-
| `/basic-auth/{user}/{pass}` | GET | Basic auth (200 if match, 401 otherwise) |
74-
| `/hidden-basic-auth/{user}/{pass}` | GET | Basic auth (200 if match, 404 otherwise)|
75-
| `/bearer` | GET | Bearer token validation |
71+
| Endpoint | Method | Description |
72+
| ---------------------------------- | ------ | ---------------------------------------- |
73+
| `/basic-auth/{user}/{pass}` | GET | Basic auth (200 if match, 401 otherwise) |
74+
| `/hidden-basic-auth/{user}/{pass}` | GET | Basic auth (200 if match, 404 otherwise) |
75+
| `/bearer` | GET | Bearer token validation |
7676

7777
### Cookie Endpoints
7878

79-
| Endpoint | Method | Description |
80-
| ----------------- | ------ | ---------------------------------------- |
81-
| `/cookies` | GET | Echo request cookies |
82-
| `/cookies/set` | GET | Set cookies (?name=value) and redirect |
83-
| `/cookies/delete` | GET | Delete cookies (?name) and redirect |
79+
| Endpoint | Method | Description |
80+
| ----------------- | ------ | -------------------------------------- |
81+
| `/cookies` | GET | Echo request cookies |
82+
| `/cookies/set` | GET | Set cookies (?name=value) and redirect |
83+
| `/cookies/delete` | GET | Delete cookies (?name) and redirect |
8484

8585
### Binary Data Endpoints
8686

87-
| Endpoint | Method | Description |
88-
| -------------- | ------ | -------------------------------- |
89-
| `/bytes/{n}` | GET | Return n random bytes (max 100KB)|
90-
| `/stream/{n}` | GET | Stream n JSON lines (max 100) |
91-
| `/drip` | GET | Drip data (?duration=&numbytes=&delay=)|
87+
| Endpoint | Method | Description |
88+
| ------------- | ------ | --------------------------------------- |
89+
| `/bytes/{n}` | GET | Return n random bytes (max 100KB) |
90+
| `/stream/{n}` | GET | Stream n JSON lines (max 100) |
91+
| `/drip` | GET | Drip data (?duration=&numbytes=&delay=) |
9292

9393
### Compression Endpoints
9494

95-
| Endpoint | Method | Description |
96-
| ----------- | ------ | ----------------------------- |
97-
| `/gzip` | GET | Return gzip-compressed response |
98-
| `/deflate` | GET | Return deflate-compressed response |
99-
| `/brotli` | GET | Return brotli-compressed response |
95+
| Endpoint | Method | Description |
96+
| ---------- | ------ | ---------------------------------- |
97+
| `/gzip` | GET | Return gzip-compressed response |
98+
| `/deflate` | GET | Return deflate-compressed response |
99+
| `/brotli` | GET | Return brotli-compressed response |
100100

101101
See [docs/api.md](./docs/api.md) for detailed API reference.
102102

0 commit comments

Comments
 (0)