fix: apply basePath correctly in dev mode for root index#3219
Conversation
|
I've identified the test failure. The builder_test.ts error is caused by the change in how dev config is handled. Working on a fix now. |
|
Fixed the test failures! The solution:
All tests now pass. The dev server correctly handles accessing the root index at `/test` when basePath is configured. Note: I extended |
9b6fb92 to
2daa513
Compare
|
The approach is sound — the devApp should be a transparent wrapper, and giving it A few things: 1.
await devApp.listen({
...options,
onListen: createOnListen(originalBasePath, options),
});This avoids modifying the public type entirely. 2. Middleware changes may be unnecessary The comments in Keeping the middlewares generic ( 3. Shallow copy of The current code does 4. Test coverage The test checks |
a2e8081 to
08aa8ad
Compare
Set devApp's basePath to "" so the dev server acts as a transparent wrapper, letting the original appHandler handle basePath routing. This fixes the root index route returning 404 when basePath is configured. The onListen callback is constructed in the builder to display the original basePath in the startup message, avoiding changes to the public ListenOptions type.
08aa8ad to
f61afcb
Compare
|
Thanks for the detailed review! I’ve addressed all the feedback:
I also changed |
Summary
Test plan
deno task ok- all tests pass except one unrelated vite dev test that appears to be flaky