2021-07-04 00:45:00 +03:00
|
|
|
export type Server = {
|
|
|
|
|
serverAdress: string
|
|
|
|
|
wsServerAdress: string
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export const server: Server = {
|
|
|
|
|
serverAdress: "https://halitaksoy.com/mancala",
|
|
|
|
|
wsServerAdress: "wss://halitaksoy.com/mancala/",
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const useLocal = true
|
|
|
|
|
|
|
|
|
|
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
|
|
|
}
|
|
|
|
|
}
|