-
-
Save ethagnawl/a611f26ff0407a8f577c73577133279e to your computer and use it in GitHub Desktop.
This file contains hidden or 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
(ns comp3.core | |
(:use compojure.core) | |
(:require [compojure.route :as route] | |
[ring.adapter.jetty :as jetty])) | |
(defn simple-logging-middleware [app] | |
(fn [req] | |
(println req) | |
(app req))) | |
(defroutes middleware-routes | |
(ANY "/" {} {:body "Hello Compojure!"}) | |
(route/not-found "Page not found")) | |
(def middleware-app | |
(-> middleware-routes | |
simple-logging-middleware)) | |
(defn start-server [] | |
(future (jetty/run-jetty (var middleware-app) {:port 8081}))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment