Skip to content
GitLab
Menu
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
Apr 17, 2021
by
Athanasios
Browse files
Error handler
parent
09b8a0fc
Changes
2
Hide whitespace changes
Inline
Side-by-side
app.js
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
)
{
...
...
src/errorHandler.js
0 → 100644
View file @
7681b81e
const
notFound
=
(
err
,
req
,
res
,
next
)
=>
{
res
.
sendStatus
(
404
);
res
.
end
();
}
module
.
exports
=
notFound
;
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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