简体   繁体   中英

How to deploy angular 8 application in local IIS server

I have created a angular 8 app with multiple sub projects inside it. and i run the production build command as below.

ng build --prod

it generated three folders one parent project folder and two folders for two sub projects. Kindly let me know how to deploy in local IIS Server.

You can simply run ng b --prod --base-href./ and copy your dist folder into you IIS Project.

The --base-href is important then otherwise angular would search for his source files in the root directory of your server.

Als create a web.config in your root directory.

Otherwise if you would call url yourApp / login , IIS would search for a login folder that does not exist. With the config the IIS does not resolve the URL from yourApp any more, and angular can do the rest

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