Skip to content

Instantly share code, notes, and snippets.

@jkyamog
Created April 3, 2014 10:11
Show Gist options
  • Save jkyamog/9951951 to your computer and use it in GitHub Desktop.
Save jkyamog/9951951 to your computer and use it in GitHub Desktop.
(defroutes product-routes
(context "/products" []
(GET "/" [] {:body (get-products)})
(GET "/index.html" [] (layout/render "product.html"))
(POST "/" {product :body-params} {:body (create-product product)})
(context "/:id" [id]
(GET "/" [] {:body (retrieve-product id)})
(POST "/" {product :body-params} {:body (update-product id product)})
(DELETE "/" [] (delete-product id)))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment