A library to integrate pathom and pedestal
This library provide one main function, pathom-routes
, which return a set of
Pedestal routes, using
the
table syntax
(ns example.core
(:require
[io.pedestal.http :as http]
[io.pedestal.http.route :as route]
[pathom.pedestal :refer [pathom-routes]]))
(def routes
(route/expand-routes (pathom-routes {:pathom-viz? true :parser parser})))
(defn create-server []
(http/create-server
{::http/routes routes
::http/type :jetty
::http/port 8890}))
(http/start (create-server))
See API docs for a list of valid options
For convenience, a helper function, make-parser
, is also provided.
See the example directory. To run it:
clj -A:demo
Go to http://localhost:8890/pathom and try some query. E.g.:
[{[:tv-show/id :bcs] [:tv-show/title]}]
For development, the demo can be used, but first is necessary to compile some dependencies, provided by pathom-viz:
git submodule update --init
make compile-viz # Build web assets (with shadow-cljs)
clj -A:dev