@ethersphere/bee-js
Version:
Javascript client for Bee
23 lines • 592 B
JavaScript
import { Types } from 'cafe-utility';
import { http } from "../utils/http.js";
/**
* Ping the base bee URL. If connection was not successful throw error
*
* @param requestOptions Options for making requests
*/
export async function checkConnection(requestOptions) {
await http(requestOptions, {
url: ''
});
}
export async function isGateway(requestOptions) {
try {
const response = await http(requestOptions, {
url: '/gateway'
});
const data = Types.asObject(response.data);
return Types.asBoolean(data.gateway);
} catch (error) {
return false;
}
}