Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
OGC
i3s-server
Commits
7681b81e
Commit
7681b81e
authored
4 years ago
by
Athanasios
Browse files
Options
Download
Email Patches
Plain Diff
Error handler
parent
09b8a0fc
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
app.js
+2
-0
app.js
src/errorHandler.js
+6
-0
src/errorHandler.js
with
8 additions
and
0 deletions
+8
-0
app.js
+
2
-
0
View file @
7681b81e
...
...
@@ -3,6 +3,7 @@ const config = require('./config')
const
cors
=
require
(
"
./src/cors
"
);
const
scenelayers
=
require
(
"
./routes/scenelayers
"
);
const
nodes
=
require
(
"
./routes/nodes
"
);
const
errorHandler
=
require
(
"
./src/errorHandler
"
);
const
port
=
config
.
PORT
||
9000
;
const
app
=
express
();
...
...
@@ -15,6 +16,7 @@ app.get("/favicon.ico", function (req, res) {
app
.
use
(
cors
);
app
.
use
(
"
/scenelayers
"
,
scenelayers
);
app
.
use
(
"
*nodes
"
,
nodes
);
app
.
use
(
errorHandler
);
app
.
listen
(
port
,
err
=>
{
if
(
err
)
{
...
...
This diff is collapsed.
Click to expand it.
src/errorHandler.js
0 → 100644
+
6
-
0
View file @
7681b81e
const
notFound
=
(
err
,
req
,
res
,
next
)
=>
{
res
.
sendStatus
(
404
);
res
.
end
();
}
module
.
exports
=
notFound
;
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment