Add a hardened systemd unit, a Caddy reverse-proxy snippet that maps /fabula/api/* to the loopback service, and Justfile build-server/ deploy-server recipes that build a static binary and ship + restart it. Includes server/README documenting the API, config, and deploy steps. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
22 lines
699 B
Caddyfile
22 lines
699 B
Caddyfile
# Caddy config for the share-link service.
|
|
#
|
|
# The frontend (served under /fabula/) calls /fabula/api/s, but the Go service
|
|
# routes plain /api/s. `uri strip_prefix /fabula` rewrites /fabula/api/s ->
|
|
# /api/s before proxying to the service on loopback.
|
|
#
|
|
# Place this INSIDE your existing site block, and make sure this /fabula/api/*
|
|
# handler comes BEFORE the static handler that serves /fabula/* — `handle`
|
|
# blocks match in source order, first match wins.
|
|
|
|
handle /fabula/api/* {
|
|
uri strip_prefix /fabula
|
|
reverse_proxy 127.0.0.1:8090
|
|
}
|
|
|
|
# ... your existing static file handler for /fabula/* follows here, e.g.:
|
|
#
|
|
# handle /fabula/* {
|
|
# root * /usr/share/caddy/public_html
|
|
# file_server
|
|
# }
|