added GetUser function

This commit is contained in:
Miloš Jovanović 2026-09-09 23:15:09 +02:00
parent 6df7c52e9e
commit b665bf63a0
5 changed files with 112 additions and 6 deletions

11
main.go
View file

@ -27,8 +27,17 @@ func main() {
log.Fatalf("sweeping stale locks: %v", err)
}
srv := NewServer(&fakeST{dept: "History", chapterID: 602}, store, secret)
apiKey := os.Getenv("ST_API_KEY")
if apiKey == "" {
log.Fatal("ST_API_KEY not set")
}
dryRun := os.Getenv("DRY_RUN") != ""
if dryRun {
log.Println("DRY_RUN set: no writes will be sent to Solidarity Tech")
}
srv := NewServer(NewClient(apiKey, dryRun), store, secret)
log.Println("listening on :8080")
log.Fatal(http.ListenAndServe(":8080", srv.Routes()))
}