SolidJSS
SolidJS2y ago
8 replies
Some Call Me Tim

API route in Route Group not picked up?

Migrating to RC1 caused my API routes in Route Groups (https://start.solidjs.com/core-concepts/routing#route-groups) to stop working? For a minimal repro, do a npm init solid@latest and create the file apiget.ts

export function GET() {
  return new Response('Hello World');
}

placing it here:
src/
    routes/
        apiget.ts


navigating to /apiget returns the proper Hello World.

placing it here:
src/
    routes/
        blah/
            apiget.ts

navigating to /blah/apiget returns the proper Hello World.

placing it here:
src/
    routes/
        (blah)/
            apiget.ts

navigating to /apiget returns a 404 now, whereas in the v.3 version, it worked and would return the proper API response.
Was this page helpful?