diff options
Diffstat (limited to 'src/pronouns/web.clj')
-rw-r--r-- | src/pronouns/web.clj | 30 |
1 files changed, 24 insertions, 6 deletions
diff --git a/src/pronouns/web.clj b/src/pronouns/web.clj index bbbce82..ab887d0 100644 --- a/src/pronouns/web.clj +++ b/src/pronouns/web.clj @@ -1,5 +1,5 @@ ;; pronoun.is - a website for pronoun usage examples -;; Copyright (C) 2014 - 2017 Morgan Astra +;; Copyright (C) 2014 - 2018 Morgan Astra ;; This program is free software: you can redistribute it and/or modify ;; it under the terms of the GNU Affero General Public License as @@ -12,18 +12,23 @@ ;; GNU Affero General Public License for more details. ;; You should have received a copy of the GNU Affero General Public License -;; along with this program. If not, see <http://www.gnu.org/licenses/> +;; along with this program. If not, see <https://www.gnu.org/licenses/> (ns pronouns.web (:require [compojure.core :refer [defroutes GET PUT POST DELETE ANY]] [compojure.handler :refer [site]] [compojure.route :as route] - [clojure.java.io :as io] [clojure.string :as s] - [ring.middleware.logger :as logger] + [clojure.java.io :as io] + [ring.adapter.jetty :as jetty] + ;; FIXME morgan.astra <2018-11-14 Wed> + ;; make this logger work or use another one + ;; [ring.middleware.logger :as logger] [ring.middleware.stacktrace :as trace] [ring.middleware.params :as params] - [ring.adapter.jetty :as jetty] + [ring.middleware.resource :refer [wrap-resource]] + [ring.middleware.content-type :refer [wrap-content-type]] + [ring.middleware.not-modified :refer [wrap-not-modified]] [environ.core :refer [env]] [pronouns.util :as u] [pronouns.pages :as pages])) @@ -34,6 +39,12 @@ :headers {"Content-Type" "text/html"} :body (pages/front)}) + (GET "/all-pronouns" [] + {:status 200 + :headers {"Content-Type" "text/html"} + :body (pages/all-pronouns)}) + + (GET "/pronouns.css" [] {:status 200 :headers {"Content-Type" "text/css"} @@ -63,7 +74,14 @@ (def app (-> app-routes - logger/wrap-with-logger + ;; FIXME morgan.astra <2018-11-14 Wed> + ;; use this resource or delete it + ;; (wrap-resource "images") + wrap-content-type + wrap-not-modified + ;; FIXME morgan.astra <2018-11-14 Wed> + ;; make this logger work or use another one + ;logger/wrap-with-logger wrap-error-page wrap-gnu-natalie-nguyen trace/wrap-stacktrace |