回答編集履歴
1
追記
test
CHANGED
@@ -17,3 +17,47 @@
|
|
17
17
|
});
|
18
18
|
|
19
19
|
```
|
20
|
+
|
21
|
+
|
22
|
+
|
23
|
+
正しく修正してください。
|
24
|
+
|
25
|
+
↓
|
26
|
+
|
27
|
+
```ここに言語を入力
|
28
|
+
|
29
|
+
// catch 404 and forward to error handler
|
30
|
+
|
31
|
+
app.use(function(req, res, next) {
|
32
|
+
|
33
|
+
next(createError(404));
|
34
|
+
|
35
|
+
});
|
36
|
+
|
37
|
+
|
38
|
+
|
39
|
+
// error handler
|
40
|
+
|
41
|
+
app.use(function(err, req, res, next) {
|
42
|
+
|
43
|
+
// set locals, only providing error in development
|
44
|
+
|
45
|
+
res.locals.message = err.message;
|
46
|
+
|
47
|
+
res.locals.error = req.app.get("env") === "development" ? err : {};
|
48
|
+
|
49
|
+
|
50
|
+
|
51
|
+
// render the error page
|
52
|
+
|
53
|
+
res.status(err.status || 500);
|
54
|
+
|
55
|
+
res.render("error");
|
56
|
+
|
57
|
+
});
|
58
|
+
|
59
|
+
|
60
|
+
|
61
|
+
module.exports = app;
|
62
|
+
|
63
|
+
```
|