Files
OwnCord/Server/admin/admin.go
T
jevb a1434ad07f feat: implement Phase 1 server skeleton with TDD
- Scaffold Go module (github.com/owncord/server) with all package dirs
- config: koanf-based YAML loader with env var overrides, default generation
- db: pure-Go SQLite (modernc, no CGO), WAL mode, FK enforcement, full
  15-table schema from SCHEMA.md including FTS5 and idempotent migrations
- auth/tls: ECDSA P-256 self-signed cert generation, LoadOrGenerate for
  all 4 TLS modes (self_signed, acme, manual, off)
- api: chi router with request ID middleware, /health and /api/v1/info
- main: graceful shutdown (30s timeout), structured slog JSON logging
- Stubs for ws, storage, admin packages ready for Phase 2+

Test coverage: api 100%, auth 85.7%, db 82.4%, config 80.6%
Binary: chatserver.exe 12MB, GOOS=windows GOARCH=amd64
2026-03-14 20:34:37 +01:00

17 lines
380 B
Go

// Package admin provides the embedded admin panel static file server.
// Full admin API implementation follows in Phase 6.
package admin
import (
"embed"
"net/http"
)
//go:embed static
var staticFiles embed.FS
// Handler returns an http.Handler that serves the embedded admin panel static files.
func Handler() http.Handler {
return http.FileServer(http.FS(staticFiles))
}