Mini HTTP server for spinning HelpViewer quickly on local environments without changing standard CORS policy on browser apps. Intended primarily for development purposes only, not for production deployment.
- Cloning this repository to your local machine
- OCI (Podman/Docker) image
This call will provide static build of source code (no external lib or binary dependencies).
CGO_ENABLED=0 \
go build -trimpath -ldflags="-s -w" -o main
The same approach is used for OCI image preparation by CI/CD pipeline.
Base : scratch
Linux systems:
podman pull ghcr.io/HelpViewer/MiniHTTPServer
mkdir ./www
podman run -p 80:8080 -v ./www:/www ghcr.io/HelpViewer/MiniHTTPServer
Webserver is accessible from port 80 via your browser with use of your IP for external network (inside Podman network access via container alias and port 8080).
- Run:
- buid.bat (on Windows)
- buid.sh (on Linux)
- Create directory www on the same level as build script
- Run ./main or .\main.exe
Parameters map:
main --port [port] --dir [directory] --addr [IP address]
| Parameter | Default | meaning |
|---|---|---|
| --port | 8080 | HTTP port on which the server listens for requests |
| --dir | www/ | The root directory with files to be served |
| --addr | 127.0.0.1: | Binding IP address. |
Caution
--addr parameter important notice:
Value: 127.0.0.1: (default) keeps the server published only within the computer.
When you start the server with the value :, you publish the server to the connected network so that external computers can access your server.