简体   繁体   中英

Running React app through Azure WebApp locally

I created a new react app and also a new project on Visual Studio: .NET Framework Web Application, under my Azure subscription.

What should be the process so when I run the Web Application locally, I will see the new react app and not the ASP.NET screen ?

I deployed the new react app to azure so when I run the website I do see the new react app, however when I run it from the .sln file, I get this screen:

在此处输入图片说明

Thanks in advance!

I think the step you missed is to update the Index view which is used to generate the website root to include the bootstrapping of the React app. It should be located at Views/Home/Index.cshtml or Pages/Index.cshtml , depending on the template you used when you created the project.

As a side note, I would consider dropping the ASP.Net project entirely and just use VS Code for the React app, through there you can easily deploy your app to an Azure Storage Account using the new Static website hosting in Azure Storage , thus removing the need for an ASP.Net website.

Hope it helps!

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