20 lines
888 B
TypeScript
20 lines
888 B
TypeScript
/******************************************************************************
|
|
* This file is auto-generated by Vaadin.
|
|
* It configures React Router automatically by adding server-side (Flow) routes,
|
|
* which is enough for Vaadin Flow applications.
|
|
* Once any `.tsx` or `.jsx` React routes are added into
|
|
* `src/main/frontend/views/` directory, this route configuration is
|
|
* re-generated automatically by Vaadin.
|
|
******************************************************************************/
|
|
import { createBrowserRouter, RouteObject } from 'react-router';
|
|
import { serverSideRoutes } from 'Frontend/generated/flow/Flow';
|
|
|
|
function build() {
|
|
const routes = [...serverSideRoutes] as RouteObject[];
|
|
return {
|
|
router: createBrowserRouter([...routes], { basename: new URL(document.baseURI).pathname }),
|
|
routes
|
|
};
|
|
}
|
|
export const { router, routes } = build()
|