4
내 코드 :Compojure의 경로 PARAMS 손실 정보
$ (checkin-app-handler {:server-port 8080 :server-name "127.0.0.1" :remote-addr "127.0.0.1" :uri "/123" :query-string "foo=1&bar=2" :scheme :http :headers {} :request-method :get})
> {:status 200, :headers {"Content-Type" "application/json"}, :body "{\"code\":\"123\",\"params\":{}}"}
내가 잘못 뭐하는 거지 :
(defn json-response [data & [status]]
{:status (or status 200)
:headers {"Content-Type" "application/json"}
:body (json/generate-string data)})
(defroutes checkin-app-handler
(GET "/:code" [code & more] (json-response {"code" code "params" more})))
나는 REPL에 파일을로드하고이 명령을 실행
에서, PARAMS가 빈 것 같다 ? 나는 쿼리 문자열에서 얻을 필요가 있지만, PARAMS지도는 항상 비어 ..