Angular 2 proxy applications

I might have looked at something obvious, but it's hard for me to get my angular2 application to work through a proxy. As far as I understand, I need to tightly bind the base href for the application and the router to work, it seems problematic when the base url can change if I go through the proxy. For example, if I host my application at http://example.com/ng2-app/ and then the proxy for http://example.com/public/app/ I get an error in the browser console: Unable to map routes. Current segment: "public". Available routes: ['/ sample', '/ request-form', '/', '/ request-view'].

Is there a way to make the application relative to their root URL and never set the root hard? I don’t understand how something works or doesn’t notice something?

+5
source share

All Articles