質問編集履歴
1
コードの書き直し
test
CHANGED
File without changes
|
test
CHANGED
@@ -16,7 +16,7 @@
|
|
16
16
|
|
17
17
|
### 発生している問題・エラーメッセージ
|
18
18
|
|
19
|
-
[nodemon] restarting due to changes...
|
19
|
+
`[nodemon] restarting due to changes...
|
20
20
|
[nodemon] starting `node server.js`
|
21
21
|
(node:50620) [MONGOOSE] DeprecationWarning: Mongoose: the `strictQuery` option will be switched back to `false` by default in Mongoose 7. Use `mongoose.set('strictQuery', false);` if you want to prepare for this change. Or use `mongoose.set('strictQuery', true);` to suppress this warning.
|
22
22
|
(Use `node --trace-deprecation ...` to show where the warning was created)
|
@@ -34,10 +34,11 @@
|
|
34
34
|
}
|
35
35
|
|
36
36
|
Node.js v18.12.1
|
37
|
-
[nodemon] app crashed - waiting for file changes before starting...
|
37
|
+
[nodemon] app crashed - waiting for file changes before starting... `
|
38
38
|
### 該当のソースコード
|
39
39
|
|
40
40
|
J Sファイル1
|
41
|
+
```ここに言語を入力
|
41
42
|
const express = require("express");
|
42
43
|
const app = express();
|
43
44
|
const mongoose = require("mongoose");
|
@@ -50,9 +51,9 @@
|
|
50
51
|
app.listen(3000, ()=>{
|
51
52
|
console.log("サーバーが起動しました");
|
52
53
|
});
|
53
|
-
|
54
|
+
```
|
54
55
|
JSファイル2
|
55
|
-
|
56
|
+
```
|
56
57
|
const mongoose = require("mongoose");
|
57
58
|
|
58
59
|
const foodSchema = new mongoose.Schema({
|
@@ -75,6 +76,7 @@
|
|
75
76
|
const Food = mongoose.model("Food",foodSchema);
|
76
77
|
|
77
78
|
module.exports = Food;
|
79
|
+
```
|
78
80
|
### 試したこと
|
79
81
|
・公式ドキュメント通りに試した
|
80
82
|
・他の解説動画などを確認した
|