27 lines
666 B
JavaScript
27 lines
666 B
JavaScript
import axios from "axios";
|
|
|
|
export default class serverRequest {
|
|
static #url = "http://localhost:8080/";
|
|
|
|
static async calc(v1 = 0, v2 = 0) {
|
|
const { data } = await axios.get(this.#url + `calc?v1=${v1}&v2=${v2}`);
|
|
return data;
|
|
}
|
|
|
|
static async toUpperCase(str = "") {
|
|
const { data } = await axios.get(this.#url + `toUpperCase?value=${str}`);
|
|
return data;
|
|
}
|
|
|
|
static async split(str= "", sep = "") {
|
|
if (sep === " ") return;
|
|
const { data } = await axios.get(this.#url + `split?value=${str}&sep=${sep}`);
|
|
return data;
|
|
}
|
|
|
|
static async toHex(number = 0) {
|
|
const { data } = await axios.get(this.#url + `toHex?number=${number}`);
|
|
return data;
|
|
}
|
|
|
|
} |