Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Azure Static Web Apps CLI ✨

License

NotificationsYou must be signed in to change notification settings

Azure/static-web-apps-cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

NPM versionNode versionCI statusContributions welcome

logo

The Static Web Apps CLI, also known as SWA CLI, serves as a local development tool forAzure Static Web Apps. It can:

  • Serve static app assets, or proxy to your app dev server
  • Serve API requests, or proxy to APIs running in Azure Functions Core Tools
  • Emulate authentication and authorization
  • Emulate Static Web Apps configuration, including routing and ACL roles
  • Deploy your app to Azure Static Web Apps

Important Notes

If you have suggestions or you encounter issues, please report them or help us fix them. Your contributions are very much appreciated. 🙏

The CLI emulates commonly used capabilities of the Azure Static Web Apps cloud service.Some differences are expected. Always deploy and test your apps in Azure to confirm behavior.

Quickstart

Installing the CLI withnpm,yarn orpnpm:

  • To install the CLI in your project, use:

    npm install -D @azure/static-web-apps-cli

    You can also install the SWA CLI globally usingnpm install -g @azure/static-web-apps-cli.

Basic usage

  • Open a SWA app folder at the root (outside any /api or /app folders):

    cd my-awesome-swa-app
  • The best way to get started is to run theswa command alone and follow the interactive prompts:

    swa

It will generate a configuration for you, then build your project and ask if you want to deploy it to Azure.

Seeswa for more details.

Extended usage

Here are the currently supportedswa commands. Useswa <command> --help to learn about options and usage for that particular command.

  • login: login into Azure
  • init: initialize a new static web app project
  • start: start the emulator from a directory or bind to a dev server
  • deploy: deploy the current project to Azure Static Web Apps
  • build: build your project

Usingnpx:

  • Open a SWA app folder at the root (outside any /api or /app folders):
cd my-awesome-swa-app
  • Create a configuration for your project:
npx @azure/static-web-apps-cli init
  • Start the emulator:
npx @azure/static-web-apps-cli start
  • Access your SWA app fromhttp://localhost:4280

See all availablecommands and options.

Want to help?

Want to file a bug, contribute some code, or improve the documentation? Excellent! Read up on our guidelines forcontributing and then check out one of our issues in the list:community-help.


[8]ページ先頭

©2009-2025 Movatter.jp