feat: initial Go project scaffold with build/test/release pipeline
- Go module: github.com/netcell-it/deklarix - cmd/server/main.go: HTTP entry point with /health endpoint - scripts/build.sh: cross-compile amd64 + arm64 - scripts/test.sh: go vet + race tests + build-check - scripts/release.sh: full release flow (test → build → tag → push) - packaging/DEBIAN: .deb control template - design/enterprise.css: enterprise design system from enconf - CLAUDE.md: complete build/test/release documentation - .claude/settings.local.json: Claude Code permissions
This commit is contained in:
27
cmd/server/main.go
Normal file
27
cmd/server/main.go
Normal file
@@ -0,0 +1,27 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"log"
|
||||
"net/http"
|
||||
"os"
|
||||
)
|
||||
|
||||
func main() {
|
||||
port := os.Getenv("PORT")
|
||||
if port == "" {
|
||||
port = "8080"
|
||||
}
|
||||
addr := ":" + port
|
||||
|
||||
mux := http.NewServeMux()
|
||||
mux.HandleFunc("/health", func(w http.ResponseWriter, r *http.Request) {
|
||||
w.Header().Set("Content-Type", "application/json")
|
||||
fmt.Fprintf(w, `{"ok":true}`)
|
||||
})
|
||||
|
||||
log.Printf("Deklarix server starting on %s", addr)
|
||||
if err := http.ListenAndServe(addr, mux); err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user