Skip to content

Commit eeca5f5

Browse files
Apply suggestions from code review
Co-authored-by: Burke Holland <[email protected]>
1 parent ab95a23 commit eeca5f5

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

articles/static-apps/local-development.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -150,25 +150,27 @@ Depending on whether or not your application is built with a JavaScript framewor
150150

151151
### Environment configuration files
152152

153-
If you are building your app with front-end frameworks that have a CLI, use environment configuration files. In the development configuration file, you can specify the path to the API, which points to the local location of `http:127.0.0.1:7071`.
153+
If you are building your app with front-end frameworks that have a CLI, you should use environment configuration files. Each framework or library has a different way of handling these environment configuration files. It's common to have a configuration file for development that is used when your application is running locally, and one for production that is used when your application is running in production. The CLI for the JavaScript framework or static site generator that you are using will automatically know to use the development file locally and the production file when your app is built by Azure Static Web Apps.
154+
155+
In the development configuration file, you can specify the path to the API, which points to the local location of `http:127.0.0.1:7071` where the API for your site is running locally.
154156

155157
```
156158
API=http:127.0.0.1:7071/api
157159
```
158160

159-
Alternatively, the production configuration specifies the path to the API as `api`.
161+
In the production configuration file, specify the path to the API as `api`. This way your application will call the api via "yoursite.com/api" when running in production.
160162

161163
```
162164
API=api
163165
```
164166

165-
This environment variable is then referenced in the web app's JavaScript.
167+
These configuration values can be referenced as Node environment variables in the web app's JavaScript.
166168

167169
```js
168170
let response = await fetch(`${process.env.API}/message`);
169171
```
170172

171-
When the application is built with its CLI, the `process.env.API` value is replaced with the value from the appropriate configuration file.
173+
When the CLI is used to run your site in development mode or to build the site for production, the `process.env.API` value is replaced with the value from the appropriate configuration file.
172174

173175
For more information on configuring environment files for front-end JavaScript frameworks and libraries, see these articles:
174176

@@ -197,4 +199,4 @@ For more information on configuring environment files for front-end JavaScript f
197199
## Next steps
198200

199201
> [!div class="nextstepaction"]
200-
> [Configure environment variables](environment-variables.md)
202+
> [Configure application settings](application-settings.md)

0 commit comments

Comments
 (0)