FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
hull-processor/server/server.js at develop · codeheroesdev/hull-processor · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
codeheroesdev
/
hull-processor
Public
forked from
hull-ships/hull-processor
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Wiki
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
hull-processor
/
server
/
server.js
Copy path
More file actions
More file actions
Latest commit
History
History
History
37 lines (29 loc) · 1001 Bytes
Breadcrumbs
hull-processor
/
server
/
server.js
Copy path
File metadata and controls
37 lines (29 loc) · 1001 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import
express
from
"express"
;
import
ComputeHandler
from
"./actions/compute-handler"
;
import
NotifyHandler
from
"./actions/notify-handler"
;
import
devMode
from
"./dev-mode"
;
export
default
function
Server
(
connector
,
options
=
{
}
)
{
const
app
=
express
(
)
;
const
{
hostSecret
}
=
options
;
app
.
post
(
"/compute"
,
ComputeHandler
(
{
hostSecret
,
connector
}
)
)
;
if
(
options
.
devMode
)
app
.
use
(
devMode
(
)
)
;
connector
.
setupApp
(
app
)
;
app
.
post
(
"/batch"
,
NotifyHandler
)
;
app
.
post
(
"/notify"
,
NotifyHandler
)
;
// Error Handler
app
.
use
(
(
err
,
req
,
res
)
=>
{
// eslint-disable-line no-unused-vars
if
(
err
)
{
const
data
=
{
status
:
err
.
status
,
segmentBody
:
req
.
segment
,
method
:
req
.
method
,
headers
:
req
.
headers
,
url
:
req
.
url
,
params
:
req
.
params
}
;
req
.
hull
.
logger
.
error
(
"Error ----------------"
,
err
.
message
,
err
.
status
,
data
)
;
}
return
res
.
status
(
err
.
status
||
500
)
.
send
(
{
message
:
err
.
message
}
)
;
}
)
;
return
app
;
}
Back
|
FazBrowse Home
|
New Git URL