We created a static web app project in azure.
Pushed the code to a github repo.
I added staticwebapp.config.json file with because the routes were throwing 404s. I'm handling 404s and every route with ReactRouter
{
"navigationFallback": {
"rewrite": "index.html"
}
}
now I'm getting this error message with a page that has only 2 routes
The content server has rejected the request with: BadRequest Reason: The number of static files was too large.
Could I be doing something wrong or is Azure only able to handle Nextjs apps and no CreateReactApp projects ?
These are the steps below to create a React app and deploy it to Azure Static Web App:
Add
staticwebapp.config.json
to the React app folder.Build and push the application to Git.
With routing:
Here are the corrected sentences:
These are the steps below to create a React app and deploy it to Azure Static Web App with routing.
npm install react-router-dom
staticwebapp.config.json:
Push the Code To Git:
Deployment status in Git Action:
Azure :