mirror of
https://github.com/Floriansylvain/RenewCMS.git
synced 2026-08-19 19:53:21 +02:00
feat: migrated prisma -> gorm
This commit is contained in:
@@ -9,6 +9,13 @@ import (
|
||||
"net/http"
|
||||
)
|
||||
|
||||
func jsonContentTypeMiddleware(next http.Handler) http.Handler {
|
||||
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
w.Header().Set("Content-Type", "application/json")
|
||||
next.ServeHTTP(w, r)
|
||||
})
|
||||
}
|
||||
|
||||
func main() {
|
||||
api.InitContainer()
|
||||
|
||||
@@ -21,6 +28,7 @@ func main() {
|
||||
|
||||
apiRouter := chi.NewRouter()
|
||||
apiRouter.Use(httplog.RequestLogger(httplog.NewLogger("GohCMS2")))
|
||||
apiRouter.Use(jsonContentTypeMiddleware)
|
||||
apiRouter.Mount("/v1", r)
|
||||
|
||||
fmt.Println("Server starting on port 8080")
|
||||
|
||||
Reference in New Issue
Block a user