/ping
/api/ping
/api/pingOverview
The /api/ping endpoint returns the current network latency (ping) in the form of a JSON response.
Endpoint
GET /api/pingExample
fetch('/api/ping')
.then(response => response.json())
.then(data => {
console.log(`Ping: ${data.ping}ms`);
});Response
The response will return a JSON object containing the ping value:
{
"ping": 25
}Description
/api/pingprovides the current network latency (ping) in milliseconds (ms).It uses the
getPing()function internally to fetch the data.The result is returned as an integer representing the network latency in milliseconds.
Last updated