52 lines
1.6 KiB
Markdown
52 lines
1.6 KiB
Markdown
# 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.
|
|
|
|
## Installation
|
|
|
|
```shell
|
|
go install codeberg.org/danjones000/http-go-status@latest
|
|
```
|
|
|
|
## Usage
|
|
|
|
```shell
|
|
http-go-status
|
|
```
|
|
|
|
Then, make a request to your server. By default, it's running on port 8080, but you can set an environment variable, called PORT, to the port you prefer before running the command.
|
|
|
|
To make your request from within a web browser (CORS is supported), you could do this from the JS console:
|
|
|
|
```javascript
|
|
let resp = await fetch("http://localhost:8080/451");
|
|
console.log(resp.status); // 451
|
|
console.log(resp.statusText); // Unavailable for Legal Reasons
|
|
```
|
|
|
|
## Deployment
|
|
|
|
I'll leave this as an exercise for the reader.
|
|
|
|
## LICENSE
|
|
|
|
Copyright (c) 2023-2025 Dan Jones
|
|
|
|
Licensed under GNU Affero General Public License as stated in the [LICENSE](LICENSE):
|
|
|
|
```text
|
|
Copyright (c) 2023-2025 Dan Jones
|
|
|
|
This program is free software: you can redistribute it and/or modify it under
|
|
the terms of the GNU Affero General Public License as published by the Free
|
|
Software Foundation, either version 3 of the License, or (at your option) any
|
|
later version.
|
|
|
|
This program is distributed in the hope that it will be useful, but WITHOUT
|
|
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
|
FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
|
|
details.
|
|
|
|
You should have received a copy of the GNU Affero General Public License along
|
|
with this program. If not, see https://www.gnu.org/licenses/
|
|
```
|