Fork me on GitHub
#pedestal
<
2016-11-23
>
jimmy00:11:29

@ddeaguiar @mtnygard Thanks for collaborating on this.Can you guys recommend the best way to design this route, this is what I have tried, and of course it does have problem regarding conflicted routing ( /api and /* ) :

(defn routes
  [interceptor]
  (route/expand-routes
   `[[["/" {:get index-page}
       ^:interceptors [bootstrap/html-body ~interceptor]
       ["/api" {:post omnext-service}
          ^:interceptors [iinterceptor/om-body-params iinterceptor/om-response]]
       ["/*" {:get index-page}
        ^:interceptors [bootstrap/html-body ~interceptor]]]]]))

mtnygard13:11:17

The key here is to use the :not-found-interceptor instead of a wildcard route.

jimmy13:11:02

@mtnygard that's neat, nice tips 😄. Thanks