File tree Expand file tree Collapse file tree 1 file changed +10
-11
lines changed
templates/cli/lib/commands Expand file tree Collapse file tree 1 file changed +10
-11
lines changed Original file line number Diff line number Diff line change @@ -68,20 +68,19 @@ const client = new Command("client")
6868 if (endpoint !== undefined) {
6969 try {
7070 let url = new URL(endpoint);
71- if (url.protocol === "http:" || url.protocol === "https:") {
72- let apClient = new Client().setEndpoint(endpoint);
73- let response = await apClient.call('GET', '/health/version');
74- if(response.version) {
75- globalConfig.setEndpoint(endpoint);
76- } else {
77- throw new Error("Invalid endpoint or your Appwrite server is not running as expected.");
78- }
79- globalConfig.setEndpoint(endpoint);
80- } else {
71+ if (url.protocol !== "http:" && url.protocol !== "https:") {
8172 throw new Error();
8273 }
74+
75+ let apClient = new Client().setEndpoint(endpoint);
76+ let response = await apClient.call('GET', '/health/version');
77+ if(!response.version) {
78+ throw new Error();
79+ }
80+
81+ globalConfig.setEndpoint(endpoint);
8382 } catch (_) {
84- throw new Error("Invalid endpoint");
83+ throw new Error("Invalid endpoint or your Appwrite server is not running as expected. ");
8584 }
8685 }
8786
You can’t perform that action at this time.
0 commit comments