Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
R
railgun-routing-server
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Railgun
railgun-routing-server
Commits
ea9c703e
Commit
ea9c703e
authored
Aug 27, 2022
by
神楽坂玲奈
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
e1fa6f57
Pipeline
#16055
failed with stages
in 17 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
15 deletions
+25
-15
server/config/config.json
server/config/config.json
+1
-1
server/src/Api.ts
server/src/Api.ts
+24
-14
No files found.
server/config/config.json
View file @
ea9c703e
{
{
"port"
:
500
,
"port"
:
500
0
,
"timeout"
:
10
,
"timeout"
:
10
,
"interval"
:
1000
,
"interval"
:
1000
,
"throttle"
:
10
"throttle"
:
10
...
...
server/src/Api.ts
View file @
ea9c703e
import
express
from
'
express
'
;
import
express
from
'
express
'
;
import
{
Router
}
from
'
./Router
'
;
import
{
Router
}
from
'
./Router
'
;
import
routers
from
'
../import/data/Router.json
'
;
export
const
api
=
express
.
Router
();
import
_
from
'
lodash
'
;
import
connections
from
'
../import/connections.json
'
;
api
.
get
(
'
/
'
,
function
(
req
,
res
,
next
)
{
const
result
=
Router
.
all
.
map
(
from
=>
({
export
const
api
=
express
.
Router
();
id
:
from
.
id
,
peers
:
from
.
peers
,
api
.
get
(
'
/
'
,
function
(
req
,
res
,
next
)
{
via
:
Object
.
fromEntries
([...
from
.
via
.
entries
()].
map
(([
to
,
via
])
=>
[
to
.
id
,
via
.
id
]))
const
result
=
Router
.
all
.
map
((
from
)
=>
({
}));
id
:
from
.
id
,
peers
:
from
.
peers
,
res
.
json
(
result
);
via
:
Object
.
fromEntries
([...
from
.
via
.
entries
()].
map
(([
to
,
via
])
=>
[
to
.
id
,
via
.
id
])),
});
}));
res
.
json
(
result
);
});
api
.
get
(
'
/routers
'
,
function
(
req
,
res
,
next
)
{
res
.
json
(
routers
.
map
((
r
)
=>
_
.
pick
(
r
,
[
'
id
'
,
'
name
'
,
'
location
'
,
'
host
'
,
'
port
'
,
'
user
'
])));
});
api
.
get
(
'
/connections
'
,
function
(
req
,
res
,
next
)
{
res
.
json
(
connections
);
});
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