New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to deploy app on IIS Server? #711
Comments
I've never used IIS, so I can't really help you here I'm afraid! I'll leave this open for a while, maybe somebody can chime in. Generally I recommend to ask questions in the Gitter channel since you'll get your answers much faster: https://gitter.im/mxstbr/react-boilerplate |
I have limited experience with IIS, however since the build folder simple contains html and js files you should have no problem with any server capable of serving HTML and JS. One minor issue I ran into when setting up is that the .htaccess file included in the build folder is needed for routing to work fully - in my case I could view the home page and navigate via links, but if I tried to type the URL to a specific page I would see an error. To solve this I enabled mod_rewrite - a Google search should reveal plenty of information about how to set this up on IIS. Hope this helps. |
no problem - let us know if it works. :) |
It worked! As correctly mentioned by @tobyl I had to override default URL settings. I couldn't figure out how to do it using IIS URL rewriting module. Instead I wrote the rules in web.config of ASP.NET project. Another way is to create an empty MVC application and configure default routing in routeConfig.cs. You can find snippets on StackOverflow for the same. Hence closing the issue. |
do you mind sharing the web.config or put up an empty boilerplate app on github? thanks |
+1 to @aogut 's comment.. Your boilerplate would really help. |
@aogut @siddhanttambe Here's the part of <system.webServer>
<rewrite>
<rules>
<rule name="React Routes" stopProcessing="true">
<match url=".*" />
<conditions logicalGrouping="MatchAll">
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
<add input="{REQUEST_URI}" pattern="^/(api)" negate="true" />
</conditions>
<action type="Rewrite" url="/" />
</rule>
</rules>
</rewrite>
</system.webServer> |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
I have back-end API written in ASP.NET Web API 2.0. I'm trying get this boilerplate work with it. What is the best way to deploy this app to IIS express or IIS Server? After building the react app I get a dump inside build directory. Do I directly serve that directory on IIS Server?
The text was updated successfully, but these errors were encountered: