- Go 100%
Serve the app with a Go backend and load commands from PostgreSQL via /api/commands instead of static docs/data catalogs. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> |
||
|---|---|---|
| .github/workflows | ||
| cmd/cliche | ||
| internal/app | ||
| public | ||
| go.mod | ||
| go.sum | ||
| README.md | ||
CLICHE
CLICHE is now served by a Go web app instead of a static Live Server workflow.
Run locally
go run .\cmd\cliche
The app listens on :8081 by default and serves public\index.html plus static assets from public\.
Commands database
Commands are loaded from the Go backend endpoint:
GET /api/commands?limit=1000
The backend reads from PostgreSQL when CLICHE_DATABASE_URL is set. It also accepts HUB_DB or standard PGHOST, PGUSER, PGPASSWORD, PGDATABASE, PGPORT, and PGSSLMODE environment variables. Command rows are read from commands.command_definitions, with a fallback to command_definitions.
Hosting
The frontend is host-ready: it calls the same-origin backend path /api/commands?limit=1000, so it is not wired to localhost.
Required hosting settings:
CLICHE_DATABASE_URL=postgres://user:password@host:5432/database?sslmode=require
Optional hosting settings:
CLICHE_ADDR=:8081
PORT=8081
CLICHE_STATIC_DIR=public
CLICHE_ADDR wins when set. Otherwise the app uses PORT, which many hosting platforms inject automatically, and falls back to :8081 for local development.
Before exposing it publicly, put it behind your normal auth or network boundary. The current app serves /api/commands without built-in authentication.