Files
kls/main.go
Kyle Isom a94b92f7fd fix deployment: use config port, not $PORT
The MCP agent sets $PORT from the route, but the Podman port mapping
expects the container to listen on the config-defined port (3030).
Remove $PORT override to avoid the mismatch. Also restore ports,
network, and user fields in the service definition.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-27 16:57:33 -07:00

39 lines
704 B
Go

package main
import (
"context"
"flag"
"log"
"net"
"net/http"
"git.wntrmute.dev/kyle/goutils/config"
"git.wntrmute.dev/kyle/goutils/die"
"git.wntrmute.dev/kyle/kls/links"
)
var defaultConfigFile = config.DefaultConfigPath("kls", "kls.conf")
func main() {
cfgFile := flag.String("f", defaultConfigFile, "`path` to config file")
flag.Parse()
err := config.LoadFile(*cfgFile)
die.If(err)
ctx := context.Background()
db, err := links.Connect(ctx)
die.If(err)
srv := &server{db: db}
http.Handle("/", srv)
addr := net.JoinHostPort(
config.Get("HTTP_ADDR"),
config.GetDefault("HTTP_PORT", "8000"),
)
log.Print("listening on ", addr)
log.Fatal(http.ListenAndServe(addr, nil))
}