feat: api serve frontend, build workflow, router readyness

This commit is contained in:
Floriansylvain
2025-12-24 01:05:58 +01:00
parent aee595dee9
commit 4a6209a8db
13 changed files with 174 additions and 74 deletions
+1 -10
View File
@@ -2,18 +2,9 @@ package middleware
import "net/http"
const KeyContentType = "Content-Type"
func JsonContentTypeMiddleware(next http.Handler) http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
w.Header().Set(KeyContentType, "application/json")
next.ServeHTTP(w, r)
})
}
func HtmlContentTypeMiddleware(next http.Handler) http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
w.Header().Set(KeyContentType, "text/html")
w.Header().Set("Content-Type", "application/json")
next.ServeHTTP(w, r)
})
}