Doesn't work in Express if I change the path of app.all(...)

The default one is app.all('/api/auth/splat', toNodeHandler(auth)). When I change to app.all('/auth/splat', toNodeHandler(auth)). It throws an error of unknown. I am using turborepo btw. Both backend and frontend set the correct path since it successfully called, but just the auth service panic.
2025-06-01T18:52:34.676Z ERROR [Better Auth]: Error Error: NOT_FOUND
at processRequest (<project path>/node_modules/.pnpm/better-call@1.0.9/node_modules/better-call/src/router.ts:129:22)
at handler (<project path>/node_modules/.pnpm/better-call@1.0.9/node_modules/better-call/src/router.ts:200:22)
at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
at async <anonymous> (<project path>/node_modules/.pnpm/better-call@1.0.9/node_modules/better-call/src/adapters/node/index.ts:11:20)
2025-06-01T18:52:34.676Z ERROR [Better Auth]: Error Error: NOT_FOUND
at processRequest (<project path>/node_modules/.pnpm/better-call@1.0.9/node_modules/better-call/src/router.ts:129:22)
at handler (<project path>/node_modules/.pnpm/better-call@1.0.9/node_modules/better-call/src/router.ts:200:22)
at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
at async <anonymous> (<project path>/node_modules/.pnpm/better-call@1.0.9/node_modules/better-call/src/adapters/node/index.ts:11:20)
No screenshot since I have solved it with an alternative. The current solution is to not change the default one, but still make this a bug. Thanks.
0 Replies
No replies yetBe the first to reply to this messageJoin

Did you find this page helpful?