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: src/content/4/en/part4a.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -460,7 +460,7 @@ app.listen(PORT, () => {
460
460
})
461
461
```
462
462
463
-
Turn the application into a functioning <i>npm</i> project. To keep your development productive, configure the application to be executed with <i>nodemon</i>. You can create a new database for your application with MongoDB Atlas, or use the same database from the previous part's exercises.
463
+
Turn the application into a functioning <i>npm</i> project. To keep your development productive, configure the application to be executed with <i>node --watch</i>. You can create a new database for your application with MongoDB Atlas, or use the same database from the previous part's exercises.
464
464
465
465
Verify that it is possible to add blogs to the list with Postman or the VS Code REST client and that the application returns the added blogs at the correct endpoint.
466
466
@@ -521,7 +521,7 @@ Let's define the <i>npm script _test_</i> for the test execution:
521
521
//...
522
522
"scripts": {
523
523
"start":"node index.js",
524
-
"dev":"nodemon index.js",
524
+
"dev":"node --watch index.js",
525
525
"build:ui":"rm -rf build && cd ../frontend/ && npm run build && cp -r build ../backend",
526
526
"deploy":"fly deploy",
527
527
"deploy:full":"npm run build:ui && npm run deploy",
"build:ui": "rm -rf build && cd ../frontend/ && npm run build && cp -r build ../backend",
34
34
"deploy": "fly deploy",
@@ -40,7 +40,7 @@ Next, let's change the scripts in our notes application <i>package.json</i> file
40
40
}
41
41
```
42
42
43
-
We specified the mode of the application to be <i>development</i> in the _npm run dev_ script that uses nodemon. We also specified that the default _npm start_ command will define the mode as <i>production</i>.
43
+
We specified the mode of the application to be <i>development</i> in the _npm run dev_ script. We also specified that the default _npm start_ command will define the mode as <i>production</i>.
44
44
45
45
There is a slight issue in the way that we have specified the mode of the application in our scripts: it will not work on Windows. We can correct this by installing the [cross-env](https://www.npmjs.com/package/cross-env) package as a development dependency with the command:
46
46
@@ -55,7 +55,7 @@ We can then achieve cross-platform compatibility by using the cross-env library
Copy file name to clipboardExpand all lines: src/content/4/fi/osa4a.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -450,7 +450,7 @@ app.listen(PORT, () => {
450
450
})
451
451
```
452
452
453
-
Tee sovelluksesta toimiva <i>npm</i>-projekti. Jotta sovelluskehitys olisi sujuvaa, konfiguroi sovellus suoritettavaksi <i>nodemonilla</i>. Voit luoda sovellukselle uuden tietokannan MongoDB Atlasiin tai käyttää edellisen osan sovelluksen tietokantaa.
453
+
Tee sovelluksesta toimiva <i>npm</i>-projekti. Jotta sovelluskehitys olisi sujuvaa, konfiguroi sovellus suoritettavaksi komennolla <i>node --watch</i>. Voit luoda sovellukselle uuden tietokannan MongoDB Atlasiin tai käyttää edellisen osan sovelluksen tietokantaa.
454
454
455
455
Varmista, että sovellukseen on mahdollista lisätä blogeja Postmanilla tai VS Code REST Clientilla ja että sovellus näyttää lisätyt blogit.
456
456
@@ -508,7 +508,7 @@ Määritellään npm-skripti <i>test</i> testien suorittamiseen:
508
508
//...
509
509
"scripts": {
510
510
"start":"node index.js",
511
-
"dev":"nodemon index.js",
511
+
"dev":"node --watch index.js",
512
512
"build:ui":"rm -rf build && cd ../frontend/ && npm run build && cp -r build ../backend",
513
513
"deploy":"fly deploy",
514
514
"deploy:full":"npm run build:ui && npm run deploy",
"build:ui": "rm -rf build && cd ../frontend/ && npm run build && cp -r build ../backend",
32
32
"deploy": "fly deploy",
@@ -38,7 +38,7 @@ Määritellään nyt tiedostossa <i>package.json</i>, että testejä suoritettae
38
38
}
39
39
```
40
40
41
-
Samalla määriteltiin, että suoritettaessa sovellusta komennolla _npm run dev_eli nodemonin avulla, on sovelluksen moodi <i>development</i>. Jos sovellusta suoritetaan normaalisti Nodella, on moodiksi määritelty <i>production</i>.
41
+
Samalla määriteltiin, että suoritettaessa sovellusta komennolla _npm run dev_ sovelluksen moodi on <i>development</i>. Jos sovellusta suoritetaan komennolla _npm start_, on moodiksi määritelty <i>production</i>.
42
42
43
43
Määrittelyssämme on kuitenkin pieni ongelma: se ei toimi Windowsilla. Tilanne korjautuu asentamalla kirjasto [cross-env](https://www.npmjs.com/package/cross-env) kehitysaikaiseksi riippuvuudeksi komennolla
44
44
@@ -53,7 +53,7 @@ ja muuttamalla <i>package.json</i> kaikilla käyttöjärjestelmillä toimivaan m
0 commit comments