Angular routes don't match on server with non-root BASE_URL (waiting on universal #495) #1479

Closed
opened 2025-08-09 17:20:18 +00:00 by fergalmoran · 0 comments
Owner

Originally created by @baserz on 7/23/2016

Hi!
Im applying the js services with prerendering to part of an application. But is having issues getting components to pre-render properly when applying app prefix (i.e using http://site/appName instead of root).

So if i would like to use /AppName/ as starting point i add <base href="/AppName/" />, set the ngCore.provide(APP_BASE_HREF, { useValue: '/AppName/' }) in boot-server.ts and add templatePrefix: "AppName" to the MapSpaFallbackRote. This effectively results in the ** route always being the prerendered content. This seems to indicate some routing issue, but it all seems correct and works fine other than this.

Is there something im missing here? Or should this be all that is needed?

*Originally created by @baserz on 7/23/2016* Hi! Im applying the js services with prerendering to part of an application. But is having issues getting components to pre-render properly when applying app prefix (i.e using http://site/appName instead of root). So if i would like to use `/AppName/` as starting point i add `<base href="/AppName/" />`, set the `ngCore.provide(APP_BASE_HREF, { useValue: '/AppName/' })` in boot-server.ts and add `templatePrefix: "AppName"` to the MapSpaFallbackRote. This effectively results in the *\* route always being the prerendered content. This seems to indicate some routing issue, but it all seems correct and works fine other than this. Is there something im missing here? Or should this be all that is needed?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github/JavaScriptServices#1479
No description provided.