switch to axios
All checks were successful
deploy / deploy (push) Successful in 32s

This commit is contained in:
Lee
2023-10-27 16:30:30 +01:00
parent 8d2cd9a234
commit 3c8b605fec
3 changed files with 53 additions and 17 deletions

View File

@ -1,13 +1,13 @@
import { Point } from "@influxdata/influxdb-client";
import axios from "axios";
import { w3cwebsocket as WebsocketClient } from "websocket";
import { InfluxWriteAPI } from "..";
import { connectMongo } from "../db/mongo";
import { LeaderboardSchema } from "../db/schemas/leaderboard";
const fetch = require("node-fetch");
async function update() {
const response = await fetch("https://scoresaber.com/api/players/count");
const count = await response.text();
const response = await axios.get("https://scoresaber.com/api/players/count");
const count = response.data;
const point = new Point("scoresaber")
.tag("type", "player_count")