feat: add initial Go+HTMX web project structure

This commit is contained in:
Grail Finder (aider)
2025-05-01 17:07:15 +03:00
commit b3a730b3dd
4 changed files with 58 additions and 0 deletions

26
cmd/web/main.go Normal file
View File

@ -0,0 +1,26 @@
package main
import (
"fmt"
"net/http"
"os"
"github.com/go-chi/chi/v5"
"github.com/go-chi/chi/v5/middleware"
)
func main() {
r := chi.NewRouter()
r.Use(middleware.Logger)
// Setup routes
r.Get("/", handleHome)
port := ":3000"
fmt.Printf("Starting server on %s\n", port)
err := http.ListenAndServe(port, r)
if err != nil {
fmt.Println(err)
os.Exit(1)
}
}