17 lines
592 B
TypeScript
17 lines
592 B
TypeScript
import Server from "@/types/Server";
|
|
|
|
class BackendService {
|
|
hasServer(): boolean {
|
|
return localStorage.getItem("server") !== null;
|
|
}
|
|
getServer(): Server {
|
|
return JSON.parse(localStorage.getItem("server") || '{"protocol":"http","host":"localhost","port":8080}');
|
|
// return JSON.parse(localStorage.getItem("server") || '{"protocol":"https","host":"bullpen-api.palaeomatiker.home64.de","port":443}');
|
|
}
|
|
updateServer(server: Server): void {
|
|
localStorage.setItem("server", JSON.stringify(server));
|
|
}
|
|
}
|
|
|
|
export default new BackendService();
|