metosin / metosin/compojure-api

Optional data-driven router

Open
#305 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Clojure
Stars
1.1k
Forks
146
PR merge metrics
No merged PRs in 30d

Description

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.

```clj
;; 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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the compojure.api.routes/Route abstraction and the routing example in the issue. Compare the proposed data-driven core with the existing macro-based approach and review examples for other routing libraries. Done would require a settled router design and working examples, but the issue does not define acceptance criteria or named tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
clojure
Domain
api, backend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.