Web Browser
AJAX
UI
HTTP request
Static content
Request
Response
Azure Functions
localhost:4200
Static Content
localhost:7071
GitHub
...
* Simplified architecture
/**
/api/**
UI
https://wassim.dev
/.auth/**
Web Browser
AJAX
Azure Functions
Static Content
Auth
aka. SWA CLI
Web Browser
AJAX
UI
Azure Functions
https://localhost:4280
Static Content
/.auth/**
Auth
Local Auth UI
/**
/api/**
func CLI
Web Browser
AJAX
UI
Azure Functions
https://localhost:4280
Static Content
http://localhost:7071
/.auth/**
http://localhost:4200
Auth
Local Auth UI
func CLI
npm install @azure/static-web-apps-cli
swa start
swa start ./dist/app
swa start ./dist/app --api ./api
swa start ./app --api http://localhost:7071
swa start http://localhost:4200 --api ./api
swa start http://localhost:4200 --api http://localhost:7071
{
"routes": [
{
"route": "/api/products",
"allowedRoles": ["authenticated"]
}
]
}