19 lines
No EOL
402 B
TypeScript
19 lines
No EOL
402 B
TypeScript
import axios from "axios";
|
|
import { apiUrl } from "./api";
|
|
|
|
export interface Server {
|
|
name?: string;
|
|
id: string;
|
|
online?: boolean;
|
|
owner: string;
|
|
url: string;
|
|
}
|
|
|
|
export const getServerList = async (): Promise<Array<Server>> => {
|
|
console.log("fetching server list");
|
|
const response = await axios.get<Array<Server>>(`${apiUrl}/servers`);
|
|
|
|
console.log(response);
|
|
|
|
return response.data;
|
|
} |