File tree Expand file tree Collapse file tree 1 file changed +11
-11
lines changed Expand file tree Collapse file tree 1 file changed +11
-11
lines changed Original file line number Diff line number Diff line change @@ -219,17 +219,17 @@ const questionsInitProject = [
219
219
type: "list",
220
220
name: "region",
221
221
message: "Select your Appwrite Cloud region",
222
- choices: [
223
- { name: "Frankfurt (fra)", value: "fra" },
224
- { name: "New York (nyc)", value: "nyc" },
225
- { name: "Sydney (syd)", value: "syd" }
226
- ],
227
- default: () => {
228
- const endpoint = globalConfig.getEndpoint() || "https://cloud.appwrite.io/v1";
229
- if (endpoint.includes('fra')) return 'fra';
230
- if (endpoint.includes('nyc')) return 'nyc';
231
- if (endpoint.includes('syd')) return 'syd';
232
- return '' ;
222
+ choices: async () => {
223
+ let client = await sdkForConsole(true);
224
+ let response = await client.call("GET", "/console/regions");
225
+ let regions = response.regions || [];
226
+ if (!regions.length) {
227
+ throw new Error("No regions found. Please check your network or Appwrite Cloud availability.");
228
+ }
229
+ return regions.filter(region => !region.disabled).map(region => ({
230
+ name: `${region.name} (${region.$id})`,
231
+ value: region.$id
232
+ })) ;
233
233
},
234
234
when: () => {
235
235
try {
You can’t perform that action at this time.
0 commit comments