From 21e3854320e42cb6172efe7c7e5b61e00af1170e Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 20 Feb 2026 10:52:22 +0000 Subject: [PATCH 1/2] Initial plan From ca5d5b37455c765b67f00136d8f78f1ab25a3938 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 20 Feb 2026 10:55:14 +0000 Subject: [PATCH 2/2] Fix stale docs: remove ** from StaticRoute.directory() path examples Co-authored-by: nielsenko <22237677+nielsenko@users.noreply.github.com> --- docs/06-concepts/18-webserver/01-overview.md | 4 ++-- docs/06-concepts/18-webserver/02-routing.md | 2 +- docs/06-concepts/18-webserver/05-static-files.md | 11 +++++------ docs/08-upgrading/01-upgrade-to-three.md | 6 +++--- 4 files changed, 11 insertions(+), 12 deletions(-) diff --git a/docs/06-concepts/18-webserver/01-overview.md b/docs/06-concepts/18-webserver/01-overview.md index e08314c3..af0783d0 100644 --- a/docs/06-concepts/18-webserver/01-overview.md +++ b/docs/06-concepts/18-webserver/01-overview.md @@ -80,7 +80,7 @@ Routes are added with a path pattern: pod.webServer.addRoute(UserRoute(), '/api/users'); // Path with wildcard -pod.webServer.addRoute(StaticRoute.directory(Directory('web')), '/static/**'); +pod.webServer.addRoute(StaticRoute.directory(Directory('web')), '/static/'); ``` Routes are matched in the order they were added. @@ -115,7 +115,7 @@ For serving CSS, JavaScript, images, or other static assets: ```dart pod.webServer.addRoute( StaticRoute.directory(Directory('web/static')), - '/static/**', + '/static/', ); ``` diff --git a/docs/06-concepts/18-webserver/02-routing.md b/docs/06-concepts/18-webserver/02-routing.md index 72e414d9..021c2355 100644 --- a/docs/06-concepts/18-webserver/02-routing.md +++ b/docs/06-concepts/18-webserver/02-routing.md @@ -282,7 +282,7 @@ pod.webServer.addRoute( Directory('web/admin'), host: 'admin.example.com', ), - '/static/**', + '/static/', ); // SPA for a specific host diff --git a/docs/06-concepts/18-webserver/05-static-files.md b/docs/06-concepts/18-webserver/05-static-files.md index 7552483c..21ea440f 100644 --- a/docs/06-concepts/18-webserver/05-static-files.md +++ b/docs/06-concepts/18-webserver/05-static-files.md @@ -13,7 +13,7 @@ final staticDir = Directory('web/static'); pod.webServer.addRoute( StaticRoute.directory(staticDir), - '/static/**', + '/static/', ); ``` @@ -22,9 +22,8 @@ For example, `web/static/logo.png` becomes accessible at `/static/logo.png`. :::info -The `/**` tail-match wildcard is required for serving directories. It matches all -paths under the prefix, allowing `StaticRoute` to map URLs to file system paths. -See [Routing](routing#wildcards) for more on wildcards. +`StaticRoute.directory()` automatically handles tail matching, so you don't need +to add `**` to the path. The route will serve all files under the given prefix. ::: @@ -39,7 +38,7 @@ pod.webServer.addRoute( staticDir, cacheControlFactory: StaticRoute.publicImmutable(maxAge: const Duration(minutes: 5)), ), - '/static/**', + '/static/', ); ``` @@ -67,7 +66,7 @@ pod.webServer.addRoute( cacheBustingConfig: cacheBustingConfig, cacheControlFactory: StaticRoute.publicImmutable(maxAge: const Duration(minutes: 5)), ), - '/static/**', + '/static/', ); ``` diff --git a/docs/08-upgrading/01-upgrade-to-three.md b/docs/08-upgrading/01-upgrade-to-three.md index ec7a16ac..a5fff310 100644 --- a/docs/08-upgrading/01-upgrade-to-three.md +++ b/docs/08-upgrading/01-upgrade-to-three.md @@ -182,7 +182,7 @@ pod.webServer.addRoute( ```dart pod.webServer.addRoute( StaticRoute.directory(Directory('web/static')), - '/static/**', + '/static/', ); ``` @@ -194,7 +194,7 @@ pod.webServer.addRoute( Directory('web/static'), cacheControlFactory: StaticRoute.publicImmutable(maxAge: 3600), ), - '/static/**', + '/static/', ); ``` @@ -217,7 +217,7 @@ pod.webServer.addRoute( immutable: true, ), ), - '/static/**', + '/static/', ); ```