$30 off During Our Annual Pro Sale. View Details »

Beyond Compojure

ayato
November 10, 2015

Beyond Compojure

ayato

November 10, 2015
Tweet

More Decks by ayato

Other Decks in Programming

Transcript

  1. Beyond Compojure @_ayato_p

  2. @_ayato_p

  3. Compojure ͱ͸ • ϧʔςΟϯάϥΠϒϥϦ • ಠࣗͷ෼഑ଋറػߏ • ϧʔτύϥϝʔλͷڧ੍ม׵ • ϚΫϩͰϧʔςΟϯάఆٛ

    • ؆୯ʹ࢖͑Δ
  4. ͜Μͳײ͡ (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))))
  5. Ͱ...?

  6. Πέͯͳ͍ • URI ͷੜ੒͕ग़དྷͳ͍ • ClojureScript Ͱ࠶ར༻ग़དྷͳ͍ • ֦ு͕೉͍͠ •

    ؆୯͚ͩͲγϯϓϧ͡Όͳ͍
  7. ຊ౰ʹཉ͍͠΋ͷ͸?

  8. ཉ͍͠΋ͷ • σʔλͱͯ͠ϧʔςΟϯάఆٛग़དྷΔ • URI ͷੜ੒͕ग़དྷΔ • ֦ு͕؆୯ • γϯϓϧͳ΋ͷ

  9. ϧʔςΟϯάϥΠϒϥϦ • Compojure • Moustache • RouteOne • Pedestal •

    gudu • secretary • silk • fnhouse • bidi
  10. σʔλͱͯ͠ఆٛग़དྷΔ • Compojure • Moustache • RouteOne • Pedestal •

    gudu • secretary • silk • fnhouse • bidi
  11. ֦ு͕؆୯ • Compojure • Moustache • RouteOne • Pedestal •

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

    bidi ͸αϙʔτͯ͠ͳ͍ • ޷Έͷ໰୊ https://carouselapps.com/2015/09/21/bidi-vs-silk/
  13. bidi Λ࢖͏

  14. ͋Ε͕͜͏એݴͰ͖Δ (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}}}])
  15. +α • ϋϯυϥʔΛఆٛ͢Δ • c.l.Keyword Λ֦ு͢Δ • ֤ϋϯυϥʔʹϝλσʔλΛ෇Ճ͢Δ http://qiita.com/ayato_p/items/8ed4688a4540491e87e0

  16. ·ͱΊ • Compojure ͚ͩ͡Όͳ͍ • Compojure ͸؆୯͚ͩͲউख͕ѱ͍ • bidi ΍

    silk ͷΑ͏ͳ΋ͷ͸࢖͍΍͍͢