Commit 3ad9c689 authored by amirouche's avatar amirouche

web: query->maybe-response: rework to use match

parent a2599b01
......@@ -192,11 +192,11 @@ exec guile -L $(pwd) -e '(@ (web) main)' -s "$0" "$@"
(and=> ((compose uri-query request-uri) request) decode))
(define (query->maybe-response query user)
((not query) (values #f #f))
((null? query) (values #f #f))
((string=? (car query) "/signin") (redirect "/signin"))
((string=? (car query) "/signup") (redirect "/signup"))))
(if (or (not query) (null? query))
(values #f #f)
(match query
(("/signin") (redirect "/signin"))
(("/signup") (redirect "/signup")))))
(define (index app request)
(let ((query (assoc-ref (request-query request) "query"))
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment