Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Beyond Compojure

ayato
November 10, 2015

Beyond Compojure

ayato

November 10, 2015
Tweet

More Decks by ayato

Other Decks in Programming

Transcript

  1. ͜Μͳײ͡ (ns example.routes (:require [compojure.core :refer [defroutes context GET POST]]))

    (defroutes main-routes (GET "/" req (home)) (context "/user" req (GET "/" req (user-index)) (GET "/new" req (user-new)) (GET "/new" req (user-new-post))) (context "/user/:id" [id] (GET "/" req (user-show id)) (GET "/edit" req (user-edit id)) (POST "/edit" req (user-edit-post id))))
  2. ֦ு͕؆୯ • Compojure • Moustache • RouteOne • Pedestal •

    gudu • secretary • silk • fnhouse • bidi
  3. bidi vs silk • ΄ͱΜͲಉ͡ • ΫΤϦʔύϥϝʔλ෇͖ URI ͷύʔεʹࠩ •

    bidi ͸αϙʔτͯ͠ͳ͍ • ޷Έͷ໰୊ https://carouselapps.com/2015/09/21/bidi-vs-silk/
  4. ͋Ε͕͜͏એݴͰ͖Δ (ns example.routes) (def main-routes ["/" {"" :home "/user" {""

    :user-index "/new" {:get :user-new :post :user-new-post}} ["/user/" [#"\d+" :id]] {"" :user-show "/edit" {:get :user-edit :post :user-edit-post}}}])