mancala/src/service/http_service.ts

33 lines
714 B
TypeScript

export type Server = {
serverAdress: string
wsServerAdress: string
}
export const server: Server = {
serverAdress: "https://segin.one/mancala-backend",
wsServerAdress: "wss://segin.one/mancala-backend/",
}
const useLocal = false
if (useLocal) {
server.serverAdress = "http://localhost:5000"
server.wsServerAdress = "ws://localhost:5000"
}
interface HttpService {
get: (route: string, succes: () => any, error: () => any) => any
}
class HttpServiceImpl implements HttpService {
public serverAdress: string
constructor(serverAdress: string) {
this.serverAdress = serverAdress
}
public get(route: string, succes: () => any, error: () => any): any {
}
}