Template
fix(template): parameterize scaffold with __PROJECT_NAME__/__MODULE_PATH__ (gitea-mcp#44)
template-go-web was seeded from the real `hostexecutor` project and never parameterized: go.mod hardcoded `module gitea.d-ma.be/mathias/hostexecutor` and `hostexecutor` appeared throughout (cmd dir, Dockerfile, Taskfile, CI, context docs). create_project_from_template therefore substituted nothing and returned a "no placeholders" partial_failure on the zero-config default path. Replaced the full module path with __MODULE_PATH__ and the bare project name with __PROJECT_NAME__ (incl. renaming cmd/hostexecutor → cmd/__PROJECT_NAME__), matching the substitution the tool performs. Also drops the stale gitea.d-ma.be host (the placeholder resolves to git.d-ma.be/<owner>/<name>). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"log/slog"
|
||||
"net/http"
|
||||
"os"
|
||||
|
||||
"__MODULE_PATH__/internal/web"
|
||||
)
|
||||
|
||||
func main() {
|
||||
logger := slog.New(slog.NewJSONHandler(os.Stdout, nil))
|
||||
|
||||
mux := http.NewServeMux()
|
||||
mux.HandleFunc("/healthz", func(w http.ResponseWriter, _ *http.Request) {
|
||||
w.WriteHeader(http.StatusOK)
|
||||
_, _ = w.Write([]byte("ok"))
|
||||
})
|
||||
mux.Handle("/", web.NewHandler())
|
||||
|
||||
addr := ":8080"
|
||||
logger.Info("__PROJECT_NAME__ starting", "addr", addr)
|
||||
if err := http.ListenAndServe(addr, mux); err != nil {
|
||||
logger.Error("server stopped", "err", err)
|
||||
os.Exit(1)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user