mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-24 03:59:50 +02:00
feat: use corsproxy.io
This commit is contained in:
1 parent
81c2ca80bc
commit
6b6ee94d9b
8 files changed
+20
-34
No files matched your search
@@ -1,15 +1,18 @@
|
||||
import { RatingsInfo } from '../../commands/ratings';
|
||||
import { Region } from '../../constants/regions';
|
||||
import { context } from '../blitzkrieg/context';
|
||||
import { withCORSProxy } from '../blitzkrieg/withCORSProxy';
|
||||
import regionToRegionSubdomain from './regionToRegionSubdomain';
|
||||
|
||||
export default async function getRatingsInfo(region: Region) {
|
||||
const response = await fetch(
|
||||
context === 'bot'
|
||||
? `https://${regionToRegionSubdomain(
|
||||
region,
|
||||
)}.wotblitz.com/en/api/rating-leaderboards/season/`
|
||||
: `/api/ratings-info/${region}`,
|
||||
withCORSProxy(
|
||||
context === 'bot'
|
||||
? `https://${regionToRegionSubdomain(
|
||||
region,
|
||||
)}.wotblitz.com/en/api/rating-leaderboards/season/`
|
||||
: `/api/ratings/info/${region}`,
|
||||
),
|
||||
);
|
||||
|
||||
return (await response.json()) as Promise<RatingsInfo>;
|
||||
|
||||
Reference in new issue
Block a user