最新
我认为您将这两个服务Web App
和Static Web App
. 该文件仅在Static Web Approutes.json
中生效。

根据 React 文档,执行以下命令创建 my-app 项目。
npx create-react-app my-app
cd my-app
npm run start
然后index2.html
在公共文件夹中创建。

在 github 中创建一个名为 的新存储库reacttest
。
在my-app目录下,打开cmd,执行如下命令,将代码上传到github。
git init
git add.
git commit -m'init'
git remote add origin https://github.com/yourname/reacttest.git
git push -u origin master
按照官方文档创建Azure Static Web Apps Preview
. Action
在 github中查看发布状态。发布后可以看到默认页面。


这时候直接routes.json
在github的public文件夹中添加文件即可。继续查看 Action 中的发布状态。发布完成后,可以看到路由已经生效。


当我们访问默认主页时,我们可以看到index2.html
.

如果想看index.html
,我们可以添加/index.html
url。
