-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* remove unused configuration files and add TypeScript configuration for functions * test * remove wrangler.toml configuration file
- Loading branch information
Showing
12 changed files
with
89 additions
and
2,924 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
interface Client { | ||
"m.homeserver": { | ||
"base_url": string; | ||
}; | ||
"org.matrix.msc3575.proxy": { | ||
"url": string; | ||
}; | ||
} | ||
|
||
export const onRequestGet: PagesFunction = async ({ request }) => { | ||
const continent: string = (request.cf.continent as string) || 'default'; | ||
let tag: string; | ||
if (continent === 'AS') { | ||
const country = request.cf.country || 'default'; | ||
if (country === 'CN') { | ||
tag = 'cn'; | ||
} else { | ||
tag = continent.toLowerCase(); | ||
} | ||
} else { | ||
tag = continent.toLowerCase(); | ||
} | ||
|
||
const r: Client = { | ||
"m.homeserver": { | ||
"base_url": `https://${tag}-matrix-client.nekos.chat` | ||
}, | ||
"org.matrix.msc3575.proxy": { | ||
"url": `https://${tag}-slidingsync.nekos.chat` | ||
} | ||
} | ||
return new Response(JSON.stringify(r), { | ||
headers: { | ||
'Access-Control-Allow-Origin': '*', | ||
'Content-Type': 'application/json' | ||
} | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
interface Server { | ||
"m.server": string; | ||
} | ||
|
||
export const onRequestGet: PagesFunction = async ({ request }) => { | ||
const continent: string = (request.cf.continent as string) || 'default'; | ||
let tag: string; | ||
if (continent === 'AS') { | ||
const country = request.cf.country || 'default'; | ||
if (country === 'CN') { | ||
tag = 'cn'; | ||
} else { | ||
tag = continent.toLowerCase(); | ||
} | ||
} else { | ||
tag = continent.toLowerCase(); | ||
} | ||
|
||
const r: Server = { | ||
"m.server": `${tag}-matrix-federation.nekos.chat:443` | ||
} | ||
return new Response(JSON.stringify(r), { | ||
headers: { | ||
'Access-Control-Allow-Origin': '*', | ||
'Content-Type': 'application/json' | ||
} | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"compilerOptions": { | ||
"target": "esnext", | ||
"module": "esnext", | ||
"lib": [ | ||
"esnext" | ||
], | ||
"types": [ | ||
"@cloudflare/workers-types" | ||
] | ||
}, | ||
"include": [ | ||
".well-known/**/*.ts" | ||
] | ||
} |
Oops, something went wrong.