[FEAT] Serving from a subdirectory
AJK74 opened this issue · 2 comments
Is your feature request related to a problem? Please describe.
In refine 3.x it was possible to configure the router to specify a base path:
Docs - Serving the application from a subdirectory
Its useful to be able to do this on a large site comprising multiple apps each of which has its own basepath.
Describe alternatives you've considered
Prefixing resource paths and routes works as a workaround.
{
name: "blog_posts",
list: basePath + "/blog-posts",
create: basePath + "/blog-posts/create",
edit: basePath + "/blog-posts/edit/:id",
show: basePath + "/blog-posts/show/:id",
meta: {
canDelete: true,
},
}
Additional context
No response
Describe the thing to improve
Would be nicer to have some inbuilt way of overriding / as the assumed base path.
Many thanks.
Hey @AJK74, in the legacy routing version (3.x.x) we've handled the composition of the router and route components. That why we've exposed a basename
prop to allow customization. This is know handled by your router component (let's say <BrowserRouter />
for react-router-dom
). You can pass basename
prop as you like and all the routes will be prefixed with it automatically.
Check out the related docs from React Router: https://v5.reactrouter.com/web/api/BrowserRouter/basename-string
Feel free to re-open if this does not resolve your issue 🙏