A tiny Go web tool that provides a simple web UI and JSON API to URL-encode and decode text.
Features
- Single binary, zero external dependencies.
- Small web UI for interactive encode/decode with Live mode and keyboard shortcuts.
- JSON endpoints for programmatic use:
/encodeand/decode.
Quick start
- Build the binary
cd /path/to/endeurl
go build -o endeurl- Run the server
./endeurlBy default the server listens on port 8080. Open http://localhost:8080 in your browser to use the web UI.
API
All API endpoints accept a POST request with a JSON body in the shape:
{ "text": "..." }- POST /encode — returns URL-encoded text
- POST /decode — returns URL-decoded text
Both endpoints respond with JSON:
{ "result": "...", "error": "..." }Examples
Using curl to encode:
curl -s -X POST http://localhost:8080/encode \
-H 'Content-Type: application/json' \
-d '{"text":"Hello world? &=/"}'
# Response:
# {"result":"Hello+world%3F+%26%3D%2F"}Using curl to decode:
curl -s -X POST http://localhost:8080/decode \
-H 'Content-Type: application/json' \
-d '{"text":"Hello+world%3F+%26%3D%2F"}'
# Response:
# {"result":"Hello world? &=/"}Notes and troubleshooting
- The web UI simulates network requests client-side; the server endpoints implement real encoding/decoding behavior used by the UI when deployed together.
- If port 8080 is already in use, stop the other service or modify the source to change the
portvariable inmain.go. - The project targets Go 1.24 (as declared in
go.mod).
Contributing
- Small, self-contained project — open a PR with improvements (better error messages, configurable port, tests, or Dockerfile).