📝 Update README
This commit is contained in:
parent
9a15c77653
commit
404b1865ca
1 changed files with 9 additions and 1 deletions
10
README.md
10
README.md
|
|
@ -1,6 +1,8 @@
|
||||||
# http-go-status
|
# http-go-status
|
||||||
|
|
||||||
Inspired by [httpstatu.us](https://github.com/aaronpowell/httpstatus), but written in Go, and is almost as minimal as possible. Only a signle dependency, and less than 100 lines of code in a single file.
|
Inspired by [httpstatu.us](https://github.com/aaronpowell/httpstatus), but written in Go, and is as minimal as possible. No third party dependencies, and less than 100 lines of code in a single file.
|
||||||
|
|
||||||
|
Previous versions had a single third-party dependency, but that's no longer necessary.
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
|
|
@ -22,8 +24,14 @@ To make your request from within a web browser (CORS is supported), you could do
|
||||||
let resp = await fetch("http://localhost:8080/451");
|
let resp = await fetch("http://localhost:8080/451");
|
||||||
console.log(resp.status); // 451
|
console.log(resp.status); // 451
|
||||||
console.log(resp.statusText); // Unavailable for Legal Reasons
|
console.log(resp.statusText); // Unavailable for Legal Reasons
|
||||||
|
|
||||||
|
resp = await fetch("http://localhost:8080/418/path/to/nothing");
|
||||||
|
console.log(resp.status); // 418
|
||||||
|
console.log(resp.statusText); // I'm a teapot
|
||||||
```
|
```
|
||||||
|
|
||||||
|
If there is no path, if the first element in the path is not an integer, or if it's an integer outside of the acceptable range, a 200 will be returned.
|
||||||
|
|
||||||
## Deployment
|
## Deployment
|
||||||
|
|
||||||
I'll leave this as an exercise for the reader.
|
I'll leave this as an exercise for the reader.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue