3 ms·
Guile's builtin server is similar: (define (hello-world-handler request request-body) (values '((content-type . (text/plain))) "Hello World
by shakna 1y ago
Guile's builtin server is similar:
(define (hello-world-handler request request-body)
(values '((content-type . (text/plain)))
"Hello World!"))
- neilv 1y agoIIUC, this is the handler for all requests, not just `GET` with path `/hello/<NAME>`. It doesn't implement what many Web "backend" developers now call "routing", which means the programmer specifying a rule-based mapping of URL patterns to a set of handlers for different kinds of requests using a simple DSL, and then at run time the library/framework performing the parsing and dispatch based on those rules. With that stock Guile library only, I think you'd instead have to manually parse the `request` argument, like in this example: https://www.gnu.org/software/guile/manual/html_node/Web-Examples.html#Inspecting-the-Request https://www.gnu.org/software/guile/manual/html_node/Web-Exam...