Remove port parameter
This commit is contained in:
@ -1,12 +1,11 @@
|
||||
const sdk = require("./fh_sdk");
|
||||
|
||||
const FAIRHOPPER_HOST = "http://127.0.0.1";
|
||||
const FAIRHOPPER_PORT = 8010;
|
||||
const FAIRHOPPER_HOST = "https://api.fairhopper.mjerenja.com";
|
||||
|
||||
async function main() {
|
||||
const fh = new sdk.FairHopper(FAIRHOPPER_HOST, FAIRHOPPER_PORT);
|
||||
const fh = new sdk.FairHopper(FAIRHOPPER_HOST);
|
||||
|
||||
console.log(`Pinging FairHopper server on ${FAIRHOPPER_HOST}:${FAIRHOPPER_PORT}`);
|
||||
console.log(`Pinging FairHopper server on ${FAIRHOPPER_HOST}`);
|
||||
const pingResult = await fh.ping();
|
||||
console.log("Ping result:", pingResult);
|
||||
console.log();
|
||||
|
||||
@ -36,9 +36,8 @@ const Direction = {
|
||||
};
|
||||
|
||||
class FairHopper {
|
||||
constructor(host, port) {
|
||||
constructor(host) {
|
||||
this.host = host;
|
||||
this.port = port;
|
||||
|
||||
this.defaultHeaders = {
|
||||
Accept: "application/json",
|
||||
@ -47,7 +46,7 @@ class FairHopper {
|
||||
}
|
||||
|
||||
formatUrl(path) {
|
||||
return `${this.host}:${this.port}${path}`;
|
||||
return `${this.host}${path}`;
|
||||
}
|
||||
|
||||
async ping() {
|
||||
|
||||
Reference in New Issue
Block a user