Implement geo backend, TS client, frontend, and CI tests.
Add a Go HTTP API with Ed25519 auth and invitation onboarding, user-scoped GeoJSON Point management, a Bun-tested @noble/ed25519 TypeScript client, static Vue/Vuetify frontend integration, and a Gitea CI workflow running both Go and Bun test suites. Made-with: Cursor
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"log"
|
||||
"net/http"
|
||||
"os"
|
||||
"time"
|
||||
|
||||
"momswap/backend/internal/app"
|
||||
httpapi "momswap/backend/internal/http"
|
||||
"momswap/backend/internal/store"
|
||||
)
|
||||
|
||||
func main() {
|
||||
addr := getEnv("ADDR", ":8080")
|
||||
adminPublicKey := os.Getenv("ADMIN_PUBLIC_KEY")
|
||||
|
||||
memory := store.NewMemoryStore()
|
||||
service := app.NewService(memory, app.Config{
|
||||
ChallengeTTL: 5 * time.Minute,
|
||||
SessionTTL: 24 * time.Hour,
|
||||
})
|
||||
service.BootstrapAdmin(adminPublicKey)
|
||||
|
||||
api := httpapi.NewAPI(service)
|
||||
log.Printf("listening on %s", addr)
|
||||
if err := http.ListenAndServe(addr, api.Routes()); err != nil {
|
||||
log.Fatalf("listen: %v", err)
|
||||
}
|
||||
}
|
||||
|
||||
func getEnv(key, fallback string) string {
|
||||
v := os.Getenv(key)
|
||||
if v == "" {
|
||||
return fallback
|
||||
}
|
||||
return v
|
||||
}
|
||||
Reference in New Issue
Block a user