Skip to content

Commit

Permalink
fix #1470 partial route-less paths messing with API
Browse files Browse the repository at this point in the history
  • Loading branch information
ryansolid committed May 8, 2024
1 parent 6c30953 commit 771aede
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/violet-lobsters-behave.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@solidjs/start": patch
---

fix #1470 partial route-less paths messing with API
2 changes: 1 addition & 1 deletion packages/start/src/router/routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ function defineRoutes(fileRoutes: Route[]) {

export function matchAPIRoute(path: string, method: string) {
const match = router.lookup(path);
if (match) {
if (match && match.route) {
const handler = match.route[`$${method}`];
if (handler === undefined) return;
return {
Expand Down

0 comments on commit 771aede

Please sign in to comment.