Skip to content

Optional data-driven router #305

Open
@ikitommi

Description

@ikitommi

The compojure.api.routes/Route abstraction enables any routing lib to be used. There could be a examples for different routing libs and there could be even a own (collect-the-best-parts-of-existing-implementations) router too. One could go fully with macros, go fully data-driven or mixin freely.

;; the data-driven core, no sweet macros
(require '[compojure.api.sour :refer :all])

;; to mixin data & macros
;; (require '[compojure.api.core :refer :all])

(def app
  (api
    {:swagger
     {:ui "/api-docs"
      :spec "/swagger.json"}}
    ;; Pedestal-style router here.
    (routes
      #{["/todo" :post (resource {:handler (constantly (ok))})]})))

would be trivial to implement.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions