mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-23 11:39:50 +02:00
feat: proxy APIs
This commit is contained in:
1 parent
7e4f195f94
commit
14bfc3018b
14 files changed
+130
-60
No files matched your search
@@ -1,6 +1,5 @@
|
||||
import { AllStats } from '../blitz/getAccountInfo';
|
||||
import { context } from '../blitzkrieg/context';
|
||||
import { withCORSProxy } from '../blitzkrieg/withCORSProxy';
|
||||
import { tankopedia } from './tankopedia';
|
||||
|
||||
export interface SpecialStats {
|
||||
@@ -86,7 +85,9 @@ tankopedia;
|
||||
export type TankAverages = Record<number, IndividualTankAverage>;
|
||||
|
||||
export const tankAverages = fetch(
|
||||
withCORSProxy('https://www.blitzstars.com/api/tankaverages.json'),
|
||||
context === 'website'
|
||||
? '/api/tank-averages'
|
||||
: 'https://www.blitzstars.com/api/tankaverages.json',
|
||||
)
|
||||
.then((response) => response.json())
|
||||
.then((json) => {
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import { deburr } from 'lodash';
|
||||
import { context } from '../blitzkrieg/context';
|
||||
import { withCORSProxy } from '../blitzkrieg/withCORSProxy';
|
||||
|
||||
export interface TankopediaEntry {
|
||||
name: string;
|
||||
@@ -19,7 +18,9 @@ export interface Tankopedia {
|
||||
}
|
||||
|
||||
export const tankopedia = fetch(
|
||||
withCORSProxy('https://www.blitzstars.com/bs-tankopedia.json'),
|
||||
context === 'website'
|
||||
? '/api/tankopedia'
|
||||
: 'https://www.blitzstars.com/bs-tankopedia.json',
|
||||
)
|
||||
.then(async (response) => response.json())
|
||||
.then((wrapperTankopedia) =>
|
||||
|
||||
Reference in new issue
Block a user