1

vaadin-router is a small client side javascript router. How do I deliver an arbitrary number of static html pages?

eeq
  • 2,108
  • 12
  • 21
xwoker
  • 3,105
  • 1
  • 30
  • 42

1 Answers1

1

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;
    }
}
eeq
  • 2,108
  • 12
  • 21
xwoker
  • 3,105
  • 1
  • 30
  • 42