functionality updates
This commit is contained in:
11
README.md
11
README.md
@@ -46,20 +46,19 @@ cargo run --release --bin coap-hello-udp
|
||||
cargo run --release --bin bridge
|
||||
```
|
||||
|
||||
Then open <http://localhost:8080/> for a test console with a name field and a
|
||||
button per route. Every response shows both the CoAP code and the HTTP status
|
||||
it was mapped to; the raw CoAP code is also returned in an `X-Coap-Code` header.
|
||||
Every response shows the CoAP code mapped onto an HTTP status, with the raw
|
||||
CoAP code returned verbatim in an `X-Coap-Code` header.
|
||||
|
||||
These are now ordinary URLs — clickable, curl-able, bookmarkable:
|
||||
|
||||
| URL | Response |
|
||||
|--------------------------------------------------|------------------------------|
|
||||
| `http://localhost:8080/` | the test console |
|
||||
| `http://localhost:8080/` | the CoAP reference page |
|
||||
| `http://localhost:8080/hello` | `Hello, World!` |
|
||||
| `http://localhost:8080/hello?name=Imran` | `Hello, Imran!` |
|
||||
| `http://localhost:8080/health` | `{"status":"ok","uptime":12}`|
|
||||
|
||||
POST needs a body, so it is easiest from the console page or curl:
|
||||
POST needs a body, so use curl:
|
||||
|
||||
```bash
|
||||
curl -X POST -d "Imran" http://localhost:8080/hello
|
||||
@@ -104,7 +103,7 @@ decoding.
|
||||
| `src/lib.rs` | Shared CoAP client used by the CLI and the bridge. |
|
||||
| `src/bin/client.rs` | CLI client for smoke tests. |
|
||||
| `src/bin/bridge.rs` | HTTP -> CoAP proxy so a browser can reach the server. |
|
||||
| `static/index.html` | The browser test console the bridge serves at `/`. |
|
||||
| `static/index.html` | CoAP reference page: routes, codes, copyable commands. |
|
||||
| `nodejs/` | The earlier Node.js version, kept for reference. |
|
||||
|
||||
## Config
|
||||
|
||||
Reference in New Issue
Block a user