2022-01-31 21:59:14 +00:00
|
|
|
import axios from "axios";
|
|
|
|
|
|
|
|
export async function squiggleWrapper(input) {
|
|
|
|
let response = await axios.post("https://server.loki.red/squiggle", {
|
|
|
|
model: `mean(${input})`,
|
|
|
|
});
|
|
|
|
if (response.status == 200) {
|
|
|
|
try {
|
|
|
|
console.log(response.data);
|
|
|
|
if (!!response.data && !!response.data.value) {
|
|
|
|
// console.log(response.data.value);
|
2022-06-15 04:46:25 +00:00
|
|
|
let result = response.data.value.value; //hd.VAL;
|
2022-01-31 21:59:14 +00:00
|
|
|
console.log(result);
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
} catch (error) {
|
|
|
|
console.log(error);
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
// squiggle("1 to 4");
|