Link breaking by typing directly in browser

0

I'm developing an angled project that is breaking the link when it has parameter and is typed directly into the browser, only occurs when it is published in IIS, if I do the same in the published in development in the "ng serve" this same error does not occurs, looking at the chrome console the error that presents me is "Uncaught SyntaxError: Unexpected token <", I noticed that in the Sources all the uploaded files are loading the index.html which is generating this error if the parameterized link is generated internally by angular clicking on a Button or Link it works correctly, but even that link pressing enter on the browser bar occurs that same problem. In IIS I am using the URL Rwriter to be able to use the routes through the web.config browser

<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="./" />      
    </rule>
   </rules>
 </rewrite>
 </system.webServer>
</configuration>

" link " does not process the .ts file, I have already tried to put some logs, and also does not pass through the interceptor that I created

    
asked by anonymous 19.09.2018 / 16:14

1 answer

1

How your url is a level above your site is your site.

You have to do the build like this:

  

ng build --base-href = / something /

or in your case

  

ng build --base-href = / checkinexpress /

    
19.09.2018 / 17:54