From c8c9c465b241062570cc3955c01fb5d59d20d888 Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Wed, 1 May 2024 19:57:48 -0300 Subject: web-routes, upd8, write: integrate web routes with url-spec [Note: due to a fantastical Rebase Fail Moment, this commit accidentally reintroduced some bad imports in upd8.js that are meant to be factored into #import-heck. So this commit is rewritten to not do that, but it means the commits in pull requests #442 and #479 don't line up with main history like they should. Oops.] --- src/write/build-modes/live-dev-server.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/write/build-modes/live-dev-server.js') diff --git a/src/write/build-modes/live-dev-server.js b/src/write/build-modes/live-dev-server.js index 464e689d..91ed4ee3 100644 --- a/src/write/build-modes/live-dev-server.js +++ b/src/write/build-modes/live-dev-server.js @@ -225,10 +225,10 @@ export async function go({ const matchedWebRoute = webRoutes - .find(({to}) => pathname.startsWith(to)); + .find(({to}) => pathname.startsWith('/' + to)); if (matchedWebRoute) { - const localFilePath = pathname.slice(matchedWebRoute.to.length); + const localFilePath = pathname.slice(1 + matchedWebRoute.to.length); // Not security tested, man, this is a dev server!! const safePath = -- cgit 1.3.0-6-gf8a5