-
Notifications
You must be signed in to change notification settings - Fork 396
Open
Labels
Description
Duplicates
- I have searched the existing issues
Latest version
- I have tested the latest version
Current behavior 😯

Expected behavior 🤔

Steps to reproduce 🕹
Steps:
- Configuring
app.config.ts
defineConfig({
server: {
baseURL:"/the_project",
},
});
- Create a file
src/routes/api/info.ts
import type { APIHandler } from '@solidjs/start/server';
export const POST: APIHandler = async (event) => {
return {
name: 'John POST',
};
};
- fetch api
fetch("/the_project/api/info", {
"method": "POST",
});
Context 🔦
After debugging, I think the bug is here
const match = matchAPIRoute(new URL(event.request.url).pathname, event.request.method); |
new URL(event.request.url).pathname
= /the_project/api/info
,but in router
is /api/info
const match = router.lookup(path); |
After modification, it can run normally
const match = matchAPIRoute(event.nativeEvent.path, event.request.method);