You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/static-web-apps/add-api.md
+14-20Lines changed: 14 additions & 20 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,11 +2,11 @@
2
2
title: Add an API to Azure Static Web Apps with Azure Functions
3
3
description: Get started with Azure Static Web Apps by adding a Serverless API to your static web app using Azure Functions.
4
4
services: static-web-apps
5
-
author: manekinekko
5
+
author: craigshoemaker
6
6
ms.service: static-web-apps
7
7
ms.topic: how-to
8
-
ms.date: 12/03/2021
9
-
ms.author: wachegha
8
+
ms.date: 08/29/2022
9
+
ms.author: cshoe
10
10
ms.custom: devx-track-js
11
11
---
12
12
@@ -28,7 +28,7 @@ You can add serverless APIs to Azure Static Web Apps that are powered by Azure F
28
28
29
29
## Create the static web app
30
30
31
-
Before adding an API, create and deploy a frontend application to Azure Static Web Apps. Use an existing app that you have already deployed or create one by following the [Building your first static site with Azure Static Web Apps](getting-started.md) quickstart.
31
+
Before adding an API, create and deploy a frontend application to Azure Static Web Apps. Use an existing app that you've already deployed or create one by following the [Building your first static site with Azure Static Web Apps](getting-started.md) quickstart.
32
32
33
33
In Visual Studio Code, open the root of your app's repository. The folder structure contains the source for your frontend app and the Static Web Apps GitHub workflow in _.github/workflows_ folder.
34
34
@@ -46,7 +46,7 @@ You create an Azure Functions project for your static web app's API. By default,
46
46
47
47
1. Press <kbd>F1</kbd> to open the Command Palette.
48
48
49
-
1. Select **Azure Static Web Apps: Create HTTP Function...**. If you're prompted to install the Azure Functions extension, install it and re-run this command.
49
+
1. Select **Azure Static Web Apps: Create HTTP Function...**. If you're prompted to install the Azure Functions extension, install it and rerun this command.
50
50
51
51
1. When prompted, enter the following values:
52
52
@@ -117,7 +117,7 @@ Update the content of the _src/index.html_ file with the following code to fetch
117
117
(async function() {
118
118
const { text } = await( await fetch(`/api/message`)).json();
@@ -308,7 +302,7 @@ Run the frontend app and API together by starting the app with the Static Web Ap
308
302
309
303
---
310
304
311
-
1.WhentheCLIprocessesstart, accessyourappat`http://localhost:4280/`. NoticehowthepagecallstheAPIanddisplaysitsoutput, `Hello from the API`.
305
+
1.WhentheCLIprocessesstart, accessyourappat[http://localhost:4280/](http://localhost:4280/). Notice how the page calls the API and displays its output, `Hello from the API`.
312
306
313
307
1.TostoptheCLI, type<kbd>Ctrl+C</kbd>.
314
308
@@ -329,7 +323,7 @@ To publish changes to your static web app in Azure, commit and push your code to
0 commit comments