Skip to content

Take control over your live stream video by running it yourself. Streaming + chat out of the box.

531 B
Raw Blame
import { createContext } from 'react';
import { ServerStatus } from '../interfaces/server-status.model';

const ENDPOINT = `/api/status`;

export interface ServerStatusStaticService {
  getStatus(): Promise<ServerStatus>;
}

class ServerStatusService {
  public static async getStatus(): Promise<ServerStatus> {
    const response = await fetch(ENDPOINT);
    const status = await response.json();
    return status;
  }
}

export const ServerStatusServiceContext =
  createContext<ServerStatusStaticService>(ServerStatusService);