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-mongoose.md
+13-9Lines changed: 13 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,7 +10,7 @@ ms.date: 01/25/2021
10
10
11
11
# Tutorial: Access data in Cosmos DB using Mongoose with Azure Static Web Apps
12
12
13
-
[Mongoose](https://mongoosejs.com/) is the most popular ODM (Object Document Mapping) client for Node.js. Allowing you to design a data structure and enforce validation, Mongoose provides all the tooling necessary to interact with databases that support the Mongoose API. [Cosmos DB](../cosmos-db/mongodb-introduction.md) supports the necessary Mongoose APIs and is available as a back-end server option on Azure.
13
+
[Mongoose](https://mongoosejs.com/) is the most popular ODM (Object Document Mapping) client for Node.js. Allowing you to design a data structure and enforce validation, Mongoose provides all the tooling necessary to interact with databases that support the MongoDB API. [Cosmos DB](../cosmos-db/mongodb-introduction.md) supports the necessary MongoDB APIs and is available as a back-end server option on Azure.
14
14
15
15
In this tutorial, you learn how to:
16
16
@@ -76,10 +76,10 @@ This tutorial uses a GitHub template repository to help you create your applicat
76
76
- Organization: Your GitHub account name
77
77
- Repository: **aswa-mongoose-tutorial**
78
78
- Branch: **main**
79
-
- Build presets: Choose **Custom**
80
-
- App location: **/public**
79
+
- Build presets: Choose **React**
80
+
- App location: **/**
81
81
- Api location: **api**
82
-
- Output location: *leave blank*
82
+
- Output location: **build**
83
83
:::image type="content" source="media/add-mongoose/azure-static-web-apps.png" alt-text="Completed Azure Static Web Apps form":::
84
84
11. Click **Review and create**
85
85
12. Click **Create**
@@ -99,10 +99,13 @@ In order to allow the web app to communicate with the database, the database con
99
99
8. Click **aswa-mongoose-tutorial** to return to the website instance
100
100
9. Under **Settings** click **Configuration**
101
101
10. Click **Add** and create a new Application Setting with the following values
102
-
- Name: **CONNECTION_STRING**
103
-
- Value: Paste the connection string you copied earlier
102
+
- Name: **AZURE_COSMOS_CONNECTION_STRING**
103
+
- Value: \<Paste the connection string you copied earlier\>
104
104
11. Click **OK**
105
-
12. Click **Save**
105
+
12. Click **Add** and create a new Application Setting with the following values for name of the database
106
+
- Name: **AZURE_COSMOS_DATABASE_NAME**
107
+
- Value: **todo**
108
+
13. Click **Save**
106
109
107
110
## Navigate to your site
108
111
@@ -113,9 +116,10 @@ You can now explore the static web app.
113
116
1. It will look similar to `https://calm-pond-05fcdb.azurestaticapps.net`
114
117
1. Click **Please login to see your list of tasks**
115
118
1. Click **Grant consent** to access the application
116
-
1. Create a new task by typing in a title and clicking **Add task**
119
+
1. Create a new lists by typing a name into the textbox labeled **create new list** and selecting **Save**
120
+
1. Create a new task by typing in a title in the textbox labled **create new item** and selecting **Save**
117
121
1. Confirm the task is displayed (it may take a moment)
118
-
1. Mark the task as complete by **clicking the checkbox**
122
+
1. Mark the task as complete by **selecting the check**; the task will be moved to the **Done items** section of the page
119
123
1.**Refresh the page** to confirm a database is being used
0 commit comments