Skip to content

Commit 2b0d1de

Browse files
committed
Update cluster code to match with suggested region Stockholm
1 parent 1dd051b commit 2b0d1de

File tree

4 files changed

+14
-14
lines changed

4 files changed

+14
-14
lines changed

src/content/3/en/part3c.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ The view displays the <i>MongoDB URI</i>, which is the address of the database t
110110
The address looks like this:
111111

112112
```js
113-
mongodb+srv://fullstack:thepasswordishere@cluster0.o1opl.mongodb.net/?retryWrites=true&w=majority
113+
mongodb+srv://fullstack:thepasswordishere@cluster0.a5qfl.mongodb.net/?retryWrites=true&w=majority
114114
```
115115

116116
We are now ready to use the database.
@@ -138,7 +138,7 @@ if (process.argv.length<3) {
138138
const password = process.argv[2]
139139

140140
const url =
141-
`mongodb+srv://fullstack:${password}@cluster0.o1opl.mongodb.net/?retryWrites=true&w=majority`
141+
`mongodb+srv://fullstack:${password}@cluster0.a5qfl.mongodb.net/?retryWrites=true&w=majority`
142142

143143
mongoose.set('strictQuery',false)
144144

@@ -186,7 +186,7 @@ Let's destroy the default database <i>test</i> and change the name of the databa
186186

187187
```js
188188
const url =
189-
`mongodb+srv://fullstack:${password}@cluster0.o1opl.mongodb.net/noteApp?retryWrites=true&w=majority`
189+
`mongodb+srv://fullstack:${password}@cluster0.a5qfl.mongodb.net/noteApp?retryWrites=true&w=majority`
190190
```
191191

192192
Let's run our code again:
@@ -368,7 +368,7 @@ const password = process.argv[2]
368368

369369
// DO NOT SAVE YOUR PASSWORD TO GITHUB!!
370370
const url =
371-
`mongodb+srv://fullstack:${password}@cluster0.o1opl.mongodb.net/?retryWrites=true&w=majority`
371+
`mongodb+srv://fullstack:${password}@cluster0.a5qfl.mongodb.net/?retryWrites=true&w=majority`
372372

373373
mongoose.set('strictQuery',false)
374374
mongoose.connect(url)
@@ -536,7 +536,7 @@ npm install dotenv
536536
To use the library, we create a <i>.env</i> file at the root of the project. The environment variables are defined inside of the file, and it can look like this:
537537

538538
```bash
539-
MONGODB_URI=mongodb+srv://fullstack:thepasswordishere@cluster0.o1opl.mongodb.net/noteApp?retryWrites=true&w=majority
539+
MONGODB_URI=mongodb+srv://fullstack:thepasswordishere@cluster0.a5qfl.mongodb.net/noteApp?retryWrites=true&w=majority
540540
PORT=3001
541541
```
542542

@@ -579,7 +579,7 @@ However, a [better option](https://community.fly.io/t/clarification-on-environme
579579
and set the env value from the command line with the command:
580580

581581
```bash
582-
fly secrets set MONGODB_URI="mongodb+srv://fullstack:thepasswordishere@cluster0.o1opl.mongodb.net/noteApp?retryWrites=true&w=majority"
582+
fly secrets set MONGODB_URI="mongodb+srv://fullstack:thepasswordishere@cluster0.a5qfl.mongodb.net/noteApp?retryWrites=true&w=majority"
583583
```
584584

585585
Since the PORT also is defined in our .env it is actually essential to ignore the file in Fly.io since otherwise the app starts in the wrong port.

src/content/3/en/part3d.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ For production, we have to set the database URL in the service that is hosting o
116116
In Fly.io that is done _fly secrets set_:
117117

118118
```bash
119-
fly secrets set MONGODB_URI='mongodb+srv://fullstack:thepasswordishere@cluster0.o1opl.mongodb.net/noteApp?retryWrites=true&w=majority'
119+
fly secrets set MONGODB_URI='mongodb+srv://fullstack:thepasswordishere@cluster0.a5qfl.mongodb.net/noteApp?retryWrites=true&w=majority'
120120
```
121121

122122
When the app is being developed, it is more than likely that something fails. Eg. when I deployed my app for the first time with the database, not a single note was seen:

src/content/3/fi/osa3c.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ Näkymä kertoo <i>MongoDB URI:n</i> eli osoitteen, jonka avulla sovelluksemme k
108108
Osoite näyttää seuraavalta:
109109

110110
```bash
111-
mongodb+srv://fullstack:thepasswordishere@cluster0.o1opl.mongodb.net/?retryWrites=true&w=majority
111+
mongodb+srv://fullstack:thepasswordishere@cluster0.a5qfl.mongodb.net/?retryWrites=true&w=majority
112112
```
113113

114114
Olemme nyt valmiina kannan käyttöön.
@@ -136,7 +136,7 @@ if (process.argv.length<3) {
136136
const password = process.argv[2]
137137

138138
const url =
139-
`mongodb+srv://fullstack:${password}@cluster0.o1opl.mongodb.net/?retryWrites=true&w=majority`
139+
`mongodb+srv://fullstack:${password}@cluster0.a5qfl.mongodb.net/?retryWrites=true&w=majority`
140140

141141
mongoose.set('strictQuery', false)
142142
mongoose.connect(url)
@@ -179,7 +179,7 @@ Tuhotaan oletusarvoisen nimen saanut kanta <i>test</i>. Päätetään käyttää
179179

180180
```js
181181
const url =
182-
`mongodb+srv://fullstack:${password}@cluster0.o1opl.mongodb.net/noteApp?retryWrites=true&w=majority`
182+
`mongodb+srv://fullstack:${password}@cluster0.a5qfl.mongodb.net/noteApp?retryWrites=true&w=majority`
183183
```
184184

185185
Suoritetaan ohjelma uudelleen:
@@ -359,7 +359,7 @@ const mongoose = require('mongoose')
359359

360360
// ÄLÄ KOSKAAN TALLETA SALASANOJA GitHubiin!
361361
const url =
362-
`mongodb+srv://fullstack:${password}@cluster0.o1opl.mongodb.net/?retryWrites=true&w=majority`
362+
`mongodb+srv://fullstack:${password}@cluster0.a5qfl.mongodb.net/?retryWrites=true&w=majority`
363363

364364
mongoose.set('strictQuery',false)
365365
mongoose.connect(url)
@@ -503,7 +503,7 @@ npm install dotenv
503503
Sovelluksen juurihakemistoon tehdään sitten tiedosto nimeltään <i>.env</i>, jonne tarvittavien ympäristömuuttujien arvot määritellään. Tiedosto näyttää seuraavalta:
504504

505505
```bash
506-
MONGODB_URI=mongodb+srv://fullstack:thepasswordishere@cluster0.o1opl.mongodb.net/noteApp?retryWrites=true&w=majority
506+
MONGODB_URI=mongodb+srv://fullstack:thepasswordishere@cluster0.a5qfl.mongodb.net/noteApp?retryWrites=true&w=majority
507507
PORT=3001
508508
```
509509

@@ -548,7 +548,7 @@ Koska Fly.io ei hyödynnä gitiä, menee myös .env-tiedosto Fly.io:n palvelimel
548548
ja asettaa ympäristömuuttujan arvo komennolla:
549549

550550
```
551-
fly secrets set MONGODB_URI='mongodb+srv://fullstack:thepasswordishere@cluster0.o1opl.mongodb.net/noteApp?retryWrites=true&w=majority'
551+
fly secrets set MONGODB_URI='mongodb+srv://fullstack:thepasswordishere@cluster0.a5qfl.mongodb.net/noteApp?retryWrites=true&w=majority'
552552
```
553553

554554
Koska .env-tiedosto määrittelee myös ympäristömuuttujan PORT arvon, on .env:in ignorointi oikeastaan välttämätöntä jotta sovellus ei yritä käynnistää itseään väärään portiin.

src/content/3/fi/osa3d.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ Huomaa, että vaikka määrittelimme sovelluskehitystä varten ympäristömuuttu
113113
Fly.io:ssa komennolla _fly secrets set_:
114114

115115
```
116-
fly secrets set MONGODB_URI='mongodb+srv://fullstack:thepasswordishere@cluster0.o1opl.mongodb.net/noteApp?retryWrites=true&w=majority'
116+
fly secrets set MONGODB_URI='mongodb+srv://fullstack:thepasswordishere@cluster0.a5qfl.mongodb.net/noteApp?retryWrites=true&w=majority'
117117
```
118118

119119
Kun sovellus viedään tuotantoon, on hyvin tavanomaista että kaikki ei toimi odotusten mukaan. Esim. ensimmäinen tuotantoonvientiyritykseni päätyi seuraavaan:

0 commit comments

Comments
 (0)