Created
April 3, 2014 10:11
-
-
Save jkyamog/9951951 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
(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