Reputation: 3171
vaadin-router is a small client side javascript router. How do I deliver an arbitrary number of static html pages?
Upvotes: 1
Views: 247
Reputation: 3171
The demo contains an example how to add router-ignore
as an attribute to an link
<a href="/users" router-ignore>Users</a>
and an example how to do deliver all files matching a specific pass as an special route
// this would be the first route in the router config:
var specialRoute =
{
path: '/external/(.*)',
action: (ctx, commands) => {
window.location.pathname = ctx.pathname;
}
};
So to deliver all html files via router we can use:
var routeStaticHtmlFiles =
{
path: '(.*)\.html',
action: (ctx, commands) => {
window.location.pathname = ctx.pathname;
}
}
Upvotes: 1