[back/perf] add content-type header

This commit is contained in:
SouthFox 2023-08-25 19:41:39 +08:00
parent 1d7a3a058f
commit 6a63ad2cac

View file

@ -1,7 +1,7 @@
(ns backend.core (ns backend.core
(:require [ring.adapter.jetty :refer [run-jetty]] (:require [ring.adapter.jetty :refer [run-jetty]]
[reitit.ring :as ring] [reitit.ring :as ring]
[ring.util.response :refer [resource-response]] [ring.util.response :refer [resource-response content-type]]
[backend.handlers :as handlers]) [backend.handlers :as handlers])
(:gen-class)) (:gen-class))
@ -9,7 +9,8 @@
(def app (def app
(ring/ring-handler (ring/ring-handler
(ring/router (ring/router
[["/" (constantly (resource-response "index.html" {:root "public"}))] [["/" (constantly (content-type (resource-response
"index.html" {:root "public"}) "text/html; charset=utf-8"))]
["/api" ["/api"
["/hp/:id" {:parameters {:path {:id int?}} ["/hp/:id" {:parameters {:path {:id int?}}
:get {:handler handlers/fetch-hu-post}}]]]) :get {:handler handlers/fetch-hu-post}}]]])