;;;; api.lisp -- http routes for dnd (in-package :dnd.api) (lzb:provision-app () :title "Dungeons & Deadlines" :version "0.1.0" :prefix "/api" :content-type "application/json" :auth 'default-auth) (defun default-auth (&rest ignore) (declare (ignore ignore)) t) (defendpoint* :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))))