summaryrefslogtreecommitdiff
path: root/api.lisp
diff options
context:
space:
mode:
authorGrant Shoshin Shangreaux <shoshin@cicadas.surf>2022-12-28 14:02:25 -0600
committerGrant Shoshin Shangreaux <shoshin@cicadas.surf>2022-12-28 14:02:25 -0600
commit72bcf7e66269af588d9daa9064de23d257cbd053 (patch)
treed0da6e22ddf93d2546fa415a44594f7be0f5b379 /api.lisp
parent2c75a754fdddb3e46e5eed95abacbcfc70334fe7 (diff)
Add: serialization for Heroes and dnd.api package
Diffstat (limited to 'api.lisp')
-rw-r--r--api.lisp16
1 files changed, 7 insertions, 9 deletions
diff --git a/api.lisp b/api.lisp
index cecacb4..ca60f21 100644
--- a/api.lisp
+++ b/api.lisp
@@ -1,8 +1,8 @@
;;;; api.lisp -- http routes for dnd
-(in-package :dnd)
+(in-package :dnd.api)
-(lzb:provision-app (api)
+(lzb:provision-app ()
:title "Dungeons & Deadlines"
:version "0.1.0"
:prefix "/api"
@@ -13,13 +13,11 @@
(declare (ignore ignore))
t)
-
-
-(defendpoint* :get "/hall-of-legends" ((filter-by identity))
+(defendpoint api :get "/heroes" ()
(:auth t)
"Get a list of heros sorted by renown"
(json:to-json
- (list :heroes
- (sort (copy-seq (db:store-objects-with-class 'hero))
- #'>
- :key #'renown))))
+ (list :|heroes|
+ (sort (copy-seq (db:store-objects-with-class 'hero))
+ #'>
+ :key #'renown))))