Skip to content

Commit

Permalink
Simplify the Compojure routes for the hello and grid views
Browse files Browse the repository at this point in the history
  • Loading branch information
hlship committed Nov 10, 2011
1 parent 57e61d8 commit ebb5965
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main.clj
Expand Up @@ -76,8 +76,8 @@

(defroutes html-routes
(GET "/hello" [] hello-world)
(GET "/cascade/grid" [] (fn [_] (grid 3 5)))
(GET "/cascade/grid/:width/:height" [width height] (fn [_] (grid (parse-int width) (parse-int height))))
(GET "/cascade/grid" [] (grid 3 5))
(GET "/cascade/grid/:width/:height" [width height] (grid (parse-int width) (parse-int height)))
; /hello/fail provokes an exception:
(GET "/hello/fail" [] (try (/ 0 0) (catch Exception e (throw (RuntimeException. "Failure dividing by zero." e))))))

Expand Down

0 comments on commit ebb5965

Please sign in to comment.