fix: replace per-path proxy with cookie-based catch-all routing
The /session/{id} URL prefix collided with OpenCode's internal
/session/{slug} SPA routes, causing a blank page. Now /c/{id} is
a thin entry point that sets a session cookie and redirects to /,
where the SPA loads at root with its router working correctly.
This also replaces ~50 individual per-path proxy route handlers
with a single /{path:path} catch-all, and simplifies the Caddyfile
from ~180 lines to ~17.
This commit is contained in:
8
Makefile
8
Makefile
@@ -52,7 +52,7 @@ try: up
|
||||
sleep 1; \
|
||||
done && \
|
||||
echo "" && \
|
||||
echo "Opening http://localhost:8080/session/$$SESSION_ID" && \
|
||||
(xdg-open "http://localhost:8080/session/$$SESSION_ID" 2>/dev/null || \
|
||||
open "http://localhost:8080/session/$$SESSION_ID" 2>/dev/null || \
|
||||
echo "Visit: http://localhost:8080/session/$$SESSION_ID")
|
||||
echo "Opening http://localhost:8080/c/$$SESSION_ID" && \
|
||||
(xdg-open "http://localhost:8080/c/$$SESSION_ID" 2>/dev/null || \
|
||||
open "http://localhost:8080/c/$$SESSION_ID" 2>/dev/null || \
|
||||
echo "Visit: http://localhost:8080/c/$$SESSION_ID")
|
||||
|
||||
Reference in New Issue
Block a user