fix: add api catch all route with 404

This commit is contained in:
Luis Pereira 2026-01-06 11:00:17 +00:00 committed by Brian O'Reilly
parent 8e60563e9d
commit bad9d4294b
1 changed files with 8 additions and 0 deletions

View File

@ -47,6 +47,14 @@
;; Set JSON as the default API format
(setf *default-api-format* "json")
(define-api || () ()
"Defines a catch all handler for non existing API routes
Overrides default radiance definition that invokes an error condition."
(api-output `(("status" . "error")
("message" . "It seems that you have hit an unidentified astronomical object."))
:message "It seems that you have hit an unidentified astronomical object."
:status 404))
;; Recently played tracks management
(defun add-recently-played (track-info &optional (stream-type :curated))
"Add a track to the recently played list (max 3 tracks).