Skip to content

Instantly share code, notes, and snippets.

@malcolmsparks
Created August 26, 2015 11:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save malcolmsparks/8145725b8c08c45fac20 to your computer and use it in GitHub Desktop.
Save malcolmsparks/8145725b8c08c45fac20 to your computer and use it in GitHub Desktop.
(ns foo.core
(:require [compojure.core :refer :all]
[ring.mock.request :refer [request]]))
(defn foo []
"I don't do a whole lot."
(context "/api" []
(context "/users" []
(context "/:user-id" [user-id]
(context "/contacts" []
;;; routes here work
(context "/:contact-id" [contact-id]
;;; anything here gives 404
;;; GET /api/users/1/contacts/1
(GET "/" [] (fn [req] {:status 200 :body "It works!"}))))))))
((foo) (request :get "/api/users/123/contacts/1/"))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment