diff --git a/backend/internal/server/server.go b/backend/internal/server/server.go index 4af9a752..866e1157 100644 --- a/backend/internal/server/server.go +++ b/backend/internal/server/server.go @@ -132,7 +132,7 @@ func (server *Server) Run() error { // TODO: Move the compiler routes to a separate file/into compiler // Apps - server.router.GET("/api/app-resources/:id/base.html", func(res http.ResponseWriter, req *http.Request, params httprouter.Params) { + server.router.GET("/api/app-resources/:id/base/*filepath", func(res http.ResponseWriter, req *http.Request, params httprouter.Params) { id := params.ByName("id") res.Header().Set("Content-Type", "text/html; charset=utf-8") diff --git a/backend/robin.servers.json b/backend/robin.servers.json index e3c0b535..61fe240d 100644 --- a/backend/robin.servers.json +++ b/backend/robin.servers.json @@ -1,5 +1,13 @@ { "devServers": { - "cli": "go run github.com/mitranim/gow -e 'go,tsx,html' run ./cmd/cli start" + "cli": { + "healthChecks": [ + { + "type": "tcp", + "port": 9010 + } + ], + "command": "go run github.com/mitranim/gow -e 'go,tsx,html' run ./cmd/cli start" + } } } diff --git a/frontend/components/AppWindow.tsx b/frontend/components/AppWindow.tsx index be540fe2..bddcb34c 100644 --- a/frontend/components/AppWindow.tsx +++ b/frontend/components/AppWindow.tsx @@ -59,6 +59,13 @@ function AppWindowContent({ id, setTitle }: AppWindowProps) { const iframeRef = React.useRef(null); const [error, setError] = React.useState(null); + const subRoute = React.useMemo( + () => + router.isReady + ? router.asPath.substring('/app/'.length + id.length) + : null, + [router.isReady, router.asPath, id], + ); React.useEffect(() => { const onMessage = (message: MessageEvent) => { @@ -143,7 +150,7 @@ function AppWindowContent({ id, setTitle }: AppWindowProps) {