feat: migrated prisma -> gorm

This commit is contained in:
Florian Sylvain
2023-08-06 19:13:49 +02:00
parent 195c247235
commit e258dccc1c
14 changed files with 149 additions and 166 deletions
+8
View File
@@ -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")