An extremely simple server for testing that returns the HTTP status you ask it to.
Find a file
Dan Jones a2b271ea59 📝 Add README
2023-11-29 16:17:10 -06:00
go.mod 🔖 It works! 2023-11-29 16:06:55 -06:00
go.sum 🔖 It works! 2023-11-29 16:06:55 -06:00
main.go 🚸 Change default port to 8080 2023-11-29 16:16:51 -06:00
README.md 📝 Add README 2023-11-29 16:17:10 -06:00

http-go-status

Inspired by httpstatu.us, 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

go install codeberg.org/danjones000/http-go-status@latest

Usage

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:

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.