@@ -115,10 +115,10 @@ Run the CLI and provide the folder that contains the API backend (a valid Azure
115115
116116``` bash
117117# static content plus API
118- swa start ./my-dist --api ./api-folder
118+ swa start ./my-dist --api-location ./api-folder
119119
120120# frontend dev server plus API
121- swa start http://localhost:3000 --api ./api-folder
121+ swa start http://localhost:3000 --api-location ./api-folder
122122```
123123
124124#### Start API server manually
@@ -128,9 +128,9 @@ When developing your backend locally, sometimes it's useful to run Azure Functio
128128To use the CLI with your local API backend dev server, follow these two steps:
129129
1301301 . Start your API using Azure Functions Core Tools: ` func host start ` or start debugging in VS Code.
131- 2 . In a separate terminal, run the SWA CLI with the ` --api ` flag and the URI of the local API server, in the following format:
131+ 2 . In a separate terminal, run the SWA CLI with the ` --api-location ` flag and the URI of the local API server, in the following format:
132132 ``` bash
133- swa start ./my-dist --api http://localhost:7071
133+ swa start ./my-dist --api-location http://localhost:7071
134134 ```
135135
136136## Use a configuration file (staticwebapp.config.json)
@@ -165,23 +165,23 @@ swa start http://localhost:3000 --swa-config-location ./my-app-source
165165
166166If you need to override the default values, provide the following options:
167167
168- | Options | Description | Default | Example |
169- | -------------------------------- | ------------------------------------------------------- | ----------------------- | ---------------------------------------------------- |
170- | ` --app-location ` | set location for the static app source code | ` ./ ` | ` --app-location="./my-project" ` |
171- | ` --app, --app-artifact- location ` | set app artifact (dist) folder or dev server | ` ./ ` | ` --app ="./my-dist" ` or ` --app =http://localhost:4200 ` |
172- | ` --api, --api-artifact- location ` | set the API folder or dev server | | ` --api="./api" ` or ` --api=http://localhost:8083 ` |
173- | ` --swa-config-location ` | set the directory of the staticwebapp.config.json file. | | ` --swa-config-location=./my-project-folder ` |
174- | ` --api-port ` | set the API server port | ` 7071 ` | ` --api-port=8082 ` |
175- | ` --host ` | set the emulator host address | ` 0.0.0.0 ` | ` --host=192.168.68.80 ` |
176- | ` --port ` | set the emulator port value | ` 4280 ` | ` --port=8080 ` |
177- | ` --ssl ` | serving the app and API over HTTPS (default: false) | ` false ` | ` --ssl ` or ` --ssl=true ` |
178- | ` --ssl-cert ` | SSL certificate to use for serving HTTPS | | ` --ssl-cert="/home/user/ssl/example.crt" ` |
179- | ` --ssl-key ` | SSL key to use for serving HTTPS | | ` --ssl-key="/home/user/ssl/example.key" ` |
180- | ` --run ` | Run a command at startup | | ` --run="cd app & npm start" ` |
181- | ` --devserver-timeout ` | The time to wait(in ms) for the dev server to start | 30000 | ` --devserver-timeout=60000 ` |
182- | ` --func-args ` | Additional arguments to pass to ` func start ` | | ` --func-args="--javascript" ` |
183- | ` --config ` | Path to swa-cli.config.json file to use. | ` ./swa-cli.config.json ` | ` --config ./config/swa-cli.config.json ` |
184- | ` --print-config ` | Print all resolved options. Useful for debugging. | | ` --print-config ` or ` --print-config=true ` |
168+ | Options | Description | Default | Example |
169+ | ----------------------- | ------------------------------------------------------- | ----------------------- | ------------------------ ---------------------------------------------------- |
170+ | ` --app-location ` | set location for the static app source code | ` ./ ` | ` --app-location="./my-project" ` |
171+ | ` --output- location ` | set app artifact (dist) folder or dev server | ` ./ ` | ` --output-location ="./my-dist" ` or ` --output-location =http://localhost:4200 ` |
172+ | ` --api- location ` | set the API folder or dev server | | ` --api-location ="./api" ` or ` --api-location =http://localhost:8083 ` |
173+ | ` --swa-config-location ` | set the directory of the staticwebapp.config.json file. | | ` --swa-config-location=./my-project-folder ` |
174+ | ` --api-port ` | set the API server port | ` 7071 ` | ` --api-port=8082 ` |
175+ | ` --host ` | set the emulator host address | ` 0.0.0.0 ` | ` --host=192.168.68.80 ` |
176+ | ` --port ` | set the emulator port value | ` 4280 ` | ` --port=8080 ` |
177+ | ` --ssl ` | serving the app and API over HTTPS (default: false) | ` false ` | ` --ssl ` or ` --ssl=true ` |
178+ | ` --ssl-cert ` | SSL certificate to use for serving HTTPS | | ` --ssl-cert="/home/user/ssl/example.crt" ` |
179+ | ` --ssl-key ` | SSL key to use for serving HTTPS | | ` --ssl-key="/home/user/ssl/example.key" ` |
180+ | ` --run ` | Run a command at startup | | ` --run="cd app & npm start" ` |
181+ | ` --devserver-timeout ` | The time to wait(in ms) for the dev server to start | 30000 | ` --devserver-timeout=60000 ` |
182+ | ` --func-args ` | Additional arguments to pass to ` func start ` | | ` --func-args="--javascript" ` |
183+ | ` --config ` | Path to swa-cli.config.json file to use. | ` ./swa-cli.config.json ` | ` --config ./config/swa-cli.config.json ` |
184+ | ` --print-config ` | Print all resolved options. Useful for debugging. | | ` --print-config ` or ` --print-config=true ` |
185185
186186## swa-cli.config.json file
187187
0 commit comments