by njrc9 on 11/18/22, 1:23 PM with 27 comments
by rstarast on 11/19/22, 9:05 AM
todoAPI conn = getTodo conn <|> getAllTodos conn
with getTodo conn = do
methodGET
pathParam @Text `is` "todos"
todoID <- pathParam @Int
...
so you need to keep in mind both the order of the alternatives in todoAPI as well as the bodies of the individual handlers. That gets unwieldy very quickly.It also seems likely to lead to the same problems with error handling that you tend to get with combinator parsers, where you usually only get details about the last failing branch, while the interesting failure might have been an earlier one.
Quiz question (I don't know the answer): What happens to a request for /todos/foo?
by mark_l_watson on 11/19/22, 3:55 PM
by njrc9 on 11/19/22, 7:15 AM
[1] https://monadic.systems/post7 [2] https://redbean.dev/#lua
by __derek__ on 11/19/22, 12:28 AM
The "Get Started" and "View on GitHub" links both have `href="/"`, so they don't work.
by jbirer on 11/18/22, 11:29 PM
by revskill on 11/19/22, 6:51 AM
by badrabbit on 11/18/22, 9:22 PM