Closed
Description
Which project does this relate to?
Start
Describe the bug
It is sometimes required to setup tanstack start app with a basepath.
For the router, it is possible to pass a basepath
to createTanStackRouter
For server fns, it is possible to set this in app.config.ts
routers: {
server: {
base: '/path/_server',
},
However, the config apiBase doesn't seem to work with a custom basepath.
tsr: {
apiBase: '/api',
// apiBase: '/path/api', <- throws 503 Server unavailable
},
And this makes it impossible to define api routes inside a subpath.
Your Example Website or App
https://stackblitz.com/edit/tanstack-router-rfnhqhpv?file=app.config.ts
Steps to Reproduce the Bug or Issue
- In attached stackblitz, update apiBase with a base url (uncomment line 25 - /path/api)
- Note error 503 Server Unavailable
Expected behavior
Should be able to provide a custom basepath for api routes, like the router itself
Screenshots or Videos

Platform
- OS: macOS
- Browser: Chrome
Additional context
No response