Wassim Chegham PRO
Senior Developer Advocate @Microsoft ★ Angular contributor ★ Bazel contributor ★ GDE @Google ★ creator of @itsjustangular / hueaction.dev / ngx.tools / xlayers.dev / angular.run / thundr.dev
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"]
}
]
}
By Wassim Chegham
With the new Static Web Apps CLI, you can now run your entire full-stack web app locally in your development environment and access many of the platform’s capabilities without deploying your app. The CLI hosts your frontend and API on a single localhost endpoint and emulates authentication, custom routing, and authorization rules. Let's have a Look at the New Azure Static Web Apps CLI.
Senior Developer Advocate @Microsoft ★ Angular contributor ★ Bazel contributor ★ GDE @Google ★ creator of @itsjustangular / hueaction.dev / ngx.tools / xlayers.dev / angular.run / thundr.dev