Files
sprintpadawan/main.go
T

32 lines
546 B
Go

package main
import (
"embed"
"log"
"net/http"
"sprintpadawan/api"
"sprintpadawan/lib"
)
//go:embed static templates
var embeddedFiles embed.FS
func main() {
lib.InitDB()
api.InitTemplates(embeddedFiles)
mux := http.NewServeMux()
// serve static assets
mux.Handle("/static/", http.FileServer(http.FS(embeddedFiles)))
api.SetupRoutes(mux)
addr := ":8080"
log.Printf("Starting SprintPadawan server on http://localhost%s", addr)
if err := http.ListenAndServe(addr, mux); err != nil {
log.Fatalf("server error: %v", err)
}
}