Add backendInfo api endpoint.
This commit is contained in:
parent
5b80b43e2a
commit
68664968da
@ -81,6 +81,7 @@ class Server {
|
|||||||
.get(config.API_ENDPOINT + 'statistics/3m', routes.get3MStatistics.bind(routes))
|
.get(config.API_ENDPOINT + 'statistics/3m', routes.get3MStatistics.bind(routes))
|
||||||
.get(config.API_ENDPOINT + 'statistics/6m', routes.get6MStatistics.bind(routes))
|
.get(config.API_ENDPOINT + 'statistics/6m', routes.get6MStatistics.bind(routes))
|
||||||
.get(config.API_ENDPOINT + 'statistics/1y', routes.get1YStatistics.bind(routes))
|
.get(config.API_ENDPOINT + 'statistics/1y', routes.get1YStatistics.bind(routes))
|
||||||
|
.get(config.API_ENDPOINT + 'backend-info', routes.getBackendInfo)
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2,6 +2,7 @@ import statistics from './api/statistics';
|
|||||||
import feeApi from './api/fee-api';
|
import feeApi from './api/fee-api';
|
||||||
import mempoolBlocks from './api/mempool-blocks';
|
import mempoolBlocks from './api/mempool-blocks';
|
||||||
import mempool from './api/mempool';
|
import mempool from './api/mempool';
|
||||||
|
import * as os from 'os';
|
||||||
|
|
||||||
class Routes {
|
class Routes {
|
||||||
private cache = {};
|
private cache = {};
|
||||||
@ -73,6 +74,12 @@ class Routes {
|
|||||||
const times = mempool.getFirstSeenForTransactions(txIds);
|
const times = mempool.getFirstSeenForTransactions(txIds);
|
||||||
res.send(times);
|
res.send(times);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public getBackendInfo(req, res) {
|
||||||
|
res.send({
|
||||||
|
'hostname': os.hostname(),
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export default new Routes();
|
export default new Routes();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user