Angular deploying to WINDOW10 IIS

Source: Internet
Author: User

1. Make sure that the IIS service is turned on.

If not open, refer to http://jingyan.baidu.com/article/eb9f7b6d9e73d1869364e8d8.html

2. Compile the angular program ng build--prod--aot.

The Dist folder appears in the post-compilation project

3. Add a Web site to IIS

4. Add the Compiled Dist folder to the Web site

5. Install URL Rewrite Module

because The angular feature is not refreshed, so the URL to the browser address linked fields does not actually map to a specific location on the magnetic disc, so we need to install

: https://www.microsoft.com/en-us/download/details.aspx?id=47337 <https://www.microsoft.com/ en-us/download/details.aspx?id=47337>

6. Create a new Web. config file. The contents are as follows

<?xml version= "1.0" encoding= "UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name= "AngularJS" 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= "/project"/>
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>

7. If there is a resource file in the project you need to copy the resource file into dist

8. The simplest set of permissions for the Dist folder can be set to the following

Angular deploying to WINDOW10 IIS

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.