From fd842a64af66c449f2bb0f889b0bc85f89f39ec6 Mon Sep 17 00:00:00 2001 From: glenneth Date: Thu, 6 Nov 2025 10:29:41 +0300 Subject: [PATCH] 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. --- asteroid.lisp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/asteroid.lisp b/asteroid.lisp index c1e22d1..1f4e23a 100644 --- a/asteroid.lisp +++ b/asteroid.lisp @@ -491,6 +491,14 @@ :default-stream-url (format nil "~a/asteroid.aac" *stream-base-url*) :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 (define-page static #@"/static/(.*)" (:uri-groups (path)) (serve-file (merge-pathnames (format nil "static/~a" path) @@ -871,13 +879,6 @@ (format t "~%Received interrupt, stopping 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 () "Ensure RADIANCE environment is properly configured for persistence" (unless (radiance:environment)