summaryrefslogtreecommitdiff
path: root/endpoints.lisp
diff options
context:
space:
mode:
Diffstat (limited to 'endpoints.lisp')
-rw-r--r--endpoints.lisp11
1 files changed, 8 insertions, 3 deletions
diff --git a/endpoints.lisp b/endpoints.lisp
index 5c2a656..19be125 100644
--- a/endpoints.lisp
+++ b/endpoints.lisp
@@ -14,8 +14,9 @@
(defendpoint* :get "/" () ()
(redirect-to "/tavern-door"))
-(defendpoint* :get "/tavern-door" () ()
- (doorkeeper))
+(defendpoint* :get "/tavern-door" ((name str)) ()
+ (if name (doorkeeper :message (format nil "M'fraid I've n'er 'eard o' ~a." name))
+ (doorkeeper)))
(defendpoint* :post "/tavern-door" () ()
(with-plist ((name :name)) (lzb:request-body)
@@ -24,7 +25,7 @@
(lzb:set-response-cookie +session-cookie-name+ (session-id sesh)
:path "/" :domain "localhost")
(redirect-to "/tavern"))
- (redirect-to "/tavern-door"))))
+ (redirect-to (format nil "/tavern-door?name=~a" (quri:url-encode name))))))
(defendpoint* :get "/godess-shrine" () ()
(godess-shrine))
@@ -40,6 +41,10 @@
(with-hero-session (hero)
(tavern hero)))
+(defun str (string)
+ "A String"
+ string)
+
(defun redirect-to (location)
"Set the lazybones response header and response code for redirecting to LOCATION.
This procedure will error if lazybones:*request* is not currently bound."