azure-static-web-apps
Helps create, configure, and deploy Azure Static Web Apps using the SWA CLI. Use when deploying static sites to Azure, setting up SWA local development, configuring staticwebapp.config.json, adding Azure Functions APIs to SWA, or setting up GitHub Actions CI/CD for Static Web
Installation
Pick a client and clone the repository into its skills directory.
Installation
About this skill
Helps create, configure, and deploy Azure Static Web Apps using the SWA CLI. Use when deploying static sites to Azure, setting up SWA local development, configuring staticwebapp.config.json, adding Azure Functions APIs to SWA, or setting up GitHub Actions CI/CD for Static Web Apps.
How to use
Zainstaluj Azure Static Web Apps CLI jako zależność deweloperską: npm install -D @azure/static-web-apps-cli. Zweryfikuj instalację poleceniem npx swa --version.
Zainicjuj projekt poleceniem swa init — to krok obowiązkowy, który automatycznie wykryje Twój framework i utworzy plik swa-cli.config.json. Nigdy nie twórz tego pliku ręcznie. Możesz użyć swa init --yes, aby zaakceptować domyślne ustawienia bez interakcji.
Uruchom lokalny emulator poleceniem swa start, który będzie dostępny pod adresem http://localhost:4280. Emulator symuluje API proxy i autentykację, pozwalając testować aplikację przed wdrożeniem.
Zaloguj się do Azure poleceniem swa login — musisz mieć aktywne konto Azure i odpowiednie uprawnienia do subskrypcji.
Wdróż aplikację na Azure poleceniem swa deploy. Skill automatycznie wyśle Twoją statyczną stronę i opcjonalnie Azure Functions API do chmury.
Opcjonalnie skonfiguruj plik staticwebapp.config.json, aby dostosować routing, nagłówki HTTP, ustawienia autentykacji lub runtime API — ten plik możesz edytować ręcznie bez ograniczeń.