For a complete tutorial, please use the Microsoft Documentation tutorial found here.
This project framework provides the following features:
- React app and API are in TypeScript
- Parent package.json with scripts to control full-stack locally
The sample is developed through the branches:
Branch name | Purpose |
---|---|
1-basic-app-with-api | Simple React app with simple /api/hello endpoint. |
2-basic-app-with-api-and-auth | Added easy authentication to React app. Authentication providers include Microsoft Active Directory, Twitter, and GitHub. |
This sample is meant to be run from either your host machine or a host machine running the dev container in Visual Studio Code.
- Installs all dependencies.
npm install
- Start the Api (Azure Functions) and App (React) projects. Wait until the entire app is running. You need to watch the terminal to verify that both port 3000 and port 7071 are up.
npm run start-dev
- Open a new terminal window and start the SWA proxy.
npm run start-swa
- Open a browser to view the proxied site.
http://localhost:4280