简体   繁体   中英

How do you define a relative path to the build files from index.html in an angular2 app?

I am using angular4 cli. I have 2 angular4 apps being served on an apache server. 1 app is made to be public and the other 1 is private and is only accessible after the user authenticates themselves. 1 app is made to be public and sits deployed in a root folder. There are no problems with this deployment and this app can be accessed fine from a web browser. The second app which is secure, is deployed under root/secure. For some reason when this app is served after the user authenticates themselves, it tries to load the javascript files of the first app which is stored under root.

My question is, how can you define in an angular4 application where to find the javascript files and assets that this app needs to run?

Thanks for any help that you may be able to provide.

Try setting the base tag in the index.html for the second application. That is what it uses to determine where to go get the files.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM