fix: Move ParenScript route before static file route

The ParenScript route must come before the catch-all static route
to properly override /static/js/auth-ui.js with dynamically compiled
JavaScript. Routes are matched in order, so specific routes must
precede general patterns.
This commit is contained in:
glenneth 2025-11-06 10:29:41 +03:00 committed by Glenn Thompson
parent 3c76436e81
commit b12e366d2c
1 changed files with 8 additions and 7 deletions

View File

@ -471,6 +471,14 @@
:default-stream-url (format nil "~a/asteroid.aac" *stream-base-url*) :default-stream-url (format nil "~a/asteroid.aac" *stream-base-url*)
:default-stream-encoding "audio/aac")) :default-stream-encoding "audio/aac"))
;;; ParenScript JavaScript Routes
;;; These routes serve dynamically compiled ParenScript as JavaScript
;;; MUST come BEFORE the static file route to override specific JS files
(define-page js-auth-ui #@"/static/js/auth-ui.js" ()
(:content-type "application/javascript")
(generate-auth-ui-js))
;; Configure static file serving for other files ;; Configure static file serving for other files
(define-page static #@"/static/(.*)" (:uri-groups (path)) (define-page static #@"/static/(.*)" (:uri-groups (path))
(serve-file (merge-pathnames (format nil "static/~a" path) (serve-file (merge-pathnames (format nil "static/~a" path)
@ -855,13 +863,6 @@
(format t "~%Received interrupt, stopping server...~%") (format t "~%Received interrupt, stopping server...~%")
(stop-server)))) (stop-server))))
;;; ParenScript JavaScript Routes
;;; These routes serve dynamically compiled ParenScript as JavaScript
(define-page js-auth-ui #@"/static/js/auth-ui.js" ()
(:content-type "application/javascript")
(generate-auth-ui-js))
(defun ensure-radiance-environment () (defun ensure-radiance-environment ()
"Ensure RADIANCE environment is properly configured for persistence" "Ensure RADIANCE environment is properly configured for persistence"
(unless (radiance:environment) (unless (radiance:environment)