I have created an angular 5 web site, with Webform or MVC I want to deploy to customers, I just want to change some variables (dbconnection, name, ...) in the webconfig file, but with angular I don't know how to do it. So every time I deploy, I have to build again, so is there a way to solve this problem?
try to add this as web.config
file with dist
folder
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="Angular Routes" stopProcessing="true">
<match url=".*" />
<conditions logicalGrouping="MatchAll">
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
</conditions>
<action type="Rewrite" url="./index.html" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>
for more i recommend reading this article: https://medium.com/angular-in-depth/deploy-an-angular-application-to-iis-60a0897742e7
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With