by williamcotton · 1y ago · 0 comments
GET /hello
|> jq: `{ world: ":)"}`
pipeline getPage =
|> jq: `{ sqlParams: [.params.id | tostring] }`
|> pg: `SELECT * FROM pages WHERE id = $1`
|> jq: `{ team: .data.rows[0] }`
GET /page/:id
|> pipeline: getPage
WIP article that explains more:https://williamcotton.com/articles/introducing-web-pipe
I would love feedback!
The validation piece makes it feel a bit a bit like the Rails mindset for people who work better in FP.
I'd make a could of suggestions for the docs: Maybe a bit more discussion of how we'd test our webpipe code. I see why you've called them 'middlewares' but, maybe the term 'macros' or 'pipeline functions' might avoid confusion with express/connect middlewares
And thanks for the motivation to for figuring out a good way to talk about testing and generally clean up the (very messy) docs.
It’s comments like yours that give someone the drive to continue.