Created
April 9, 2020 10:53
-
-
Save ertugrulcetin/2324ade7546c8d7809402e5c88197899 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn wrap-some-data | |
[handler] | |
(fn [request] | |
(let [updated-request (assoc request :site-owner "Ertuğrul")] | |
;; ▼▼▼ returns response ▼▼▼ | |
(handler updated-request)))) | |
;; :resource-ns-path -> src/clj_web_app dizini altındaki namespace'leri tarar ve tüm `resource`'ları bulup döndürür | |
(def app-routes (get-routes {:resource-ns-path "clj-web-app." | |
:not-found-route 'clj-web-app.core/not-found})) | |
(def handler (-> #'app-routes | |
wrap-reload | |
wrap-some-data | |
wrap-cookies | |
wrap-gzip)) | |
(defn -main | |
[& args] | |
(run-jetty handler {:port 3000})) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment