mancala/src/service/http_service.ts

33 lines
714 B
TypeScript
Raw Normal View History

2021-07-04 00:45:00 +03:00
export type Server = {
serverAdress: string
wsServerAdress: string
}
export const server: Server = {
2022-04-11 22:37:57 +03:00
serverAdress: "https://segin.one/mancala-backend",
wsServerAdress: "wss://segin.one/mancala-backend/",
2021-07-04 00:45:00 +03:00
}
2021-07-04 01:52:56 +03:00
const useLocal = false
2021-07-04 00:45:00 +03:00
if (useLocal) {
server.serverAdress = "http://localhost:5000"
server.wsServerAdress = "ws://localhost:5000"
}
2021-06-30 22:23:38 +03:00
2021-06-27 19:28:47 +03:00
interface HttpService {
get: (route: string, succes: () => any, error: () => any) => any
}
2021-07-04 00:45:00 +03:00
class HttpServiceImpl implements HttpService {
public serverAdress: string
2021-06-27 19:28:47 +03:00
2021-07-04 00:45:00 +03:00
constructor(serverAdress: string) {
2021-06-27 19:28:47 +03:00
this.serverAdress = serverAdress
}
2021-07-04 00:45:00 +03:00
public get(route: string, succes: () => any, error: () => any): any {
2021-06-27 19:28:47 +03:00
}
}