Commit ea9c703e authored by 神楽坂玲奈's avatar 神楽坂玲奈

fix

parent e1fa6f57
Pipeline #16055 failed with stages
in 17 seconds
{ {
"port": 500, "port": 5000,
"timeout": 10, "timeout": 10,
"interval": 1000, "interval": 1000,
"throttle": 10 "throttle": 10
......
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);
});
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment