Commit eb7c8e76 authored by amirouche's avatar amirouche

web: add wiredtiger

parent c2eda6e7
......@@ -25,6 +25,12 @@ exec guile -L $(pwd) -e '(@ (web) main)' -s "$0" "$@"
(use-modules ((web server)))
(use-modules ((web uri)))
;; third party
(use-modules ((wiredtiger extra)))
(use-modules ((wiredtiger feature-space)))
(use-modules ((wiredtiger grf3)))
(use-modules ((wiredtiger wiredtiger)))
;; local
(use-modules ((web decode)))
(use-modules ((web helpers)))
......@@ -225,15 +231,17 @@ exec guile -L $(pwd) -e '(@ (web) main)' -s "$0" "$@"
(sxml->response (signup/template errors))))))
(define (handler request body)
(match (cons (request-method request) (request-path-components request))
('(GET) (index request))
('(GET "signin") (signin/get request))
('(POST "signin") (signin/post request post))
('(GET "signup") (signup/get request))
('(POST "signup") (signup/post request body))
(('GET "static" path ...) (render-static-asset path))
(_ (not-found (uri-path (request-uri request))))))
(with-context*
(match (cons (request-method request) (request-path-components request))
('(GET) (index request))
('(GET "signin") (signin/get request))
('(POST "signin") (signin/post request post))
('(GET "signup") (signup/get request))
('(POST "signup") (signup/post request body))
(('GET "static" path ...) (render-static-asset path))
(_ (not-found (uri-path (request-uri request)))))))
(define-public (main _)
(format #t "Server running @ http://localhost:8080\n")
(run-server handler))
(with-env (env-open* "wt" (list *feature-space*) "create,log=(enabled=true)")
(run-server handler)))
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