Fork me on GitHub
#pathom
<
2019-01-17
>
mss16:01:44

hey all, are there any docs around about integrating pathom with the fulcro easy server?

tony.kay18:01:46

Don’t use easy server…really. It is very simple to roll your own. The new template sets it all up for you.

souenzzo17:01:15

@mss i think that it's underdocumented CLJS - When you create new-fulcro-client, you can pass (fc/new-fulcro-client :networking (net/fulcro-http-remote {:url "//localhost:8080/api"})) CLJ - Create a pedestal webserver in 8080 - create a route in POST/api. It should read and write transit - you can take all (parsed) body from /api and pass to your parser {:body (edn->transit (my-parser/parser {:my-db {...}} body)) :status 200}

👍 5
souenzzo17:01:05

pedestal or any ring'ie. I know nothing about "fulcro server". Maybe can be easier use fulcro server and just exchange the parser part.

mss17:01:56

figured it out after a little tinkering — didn’t realize I needed to roll my own handler vs using the fulcro one out of the box. appreciate the help!

souenzzo17:01:41

@mss from lein new fulcro my-project inside src/main/my_project/server_components/middleware.clj just remove (def server-parser (server/fulcro-parser)) And use (def server-parser (p/parser {.. pathom stuff ..}))

souenzzo17:01:49

it should be way easier then create a new webserver... And should keep debug/support easier 🙂

👍 5
Daniel Hines18:01:52

I’ve asked this same question myself. Thanks for this clear answer @souenzzo

souenzzo19:01:15

PRO TIP: df/load has a great doc