core icon indicating copy to clipboard operation
core copied to clipboard

Add client-side routing support for virtual directories

Open Jand42 opened this issue 7 years ago • 1 comments

If Context.ApplicationPath is not "/", Sitelets runtime could add a <meta name="app-path" content="/virtualDir"> tag to head.

Client-side routing would read this once when initializing it, and automatically skip base path when parsing URLs, and add it when writing. This would make server/client routing work without changes automatically when deploying a WebSharper application under a virtual directory.

Jand42 avatar Feb 08 '18 14:02 Jand42

Or better, client-side routing should take into consideration the html base tag path when parsing, similar to https://fsbolero.io/docs/Routing

It would be a breaking change if WebSharper server-side would auto-add base to each page based on a template, so some explicit change would be required, for example adding<base href="${BasePath}"> to the template and filling it in server-side code with .BasePath(ctx.ApplicationPath).

Jand42 avatar Jun 14 '19 08:06 Jand42