File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11'use strict'
2- class Backend {
3- static call ( module = '' , data ) {
4- let backend = Backend . getBackend ( ) ;
5- return fetch ( new Request ( backend . path + '/' + module ) , {
2+ class Backend {
3+ static call ( module = '' , data ) {
4+ return fetch ( new Request ( BackendService . getBackend ( ) + '/' + module ) , {
65 method : 'POST' ,
7- headers : new Headers ( backend . headers ) ,
86 body : JSON . stringify ( data )
97 } ) ;
108 }
119 static getBackend ( ) {
12- try {
13- let backend = localStorage . getItem ( 'backend' ) ;
14- if ( backend ) {
15- return JSON . parse ( backend ) ;
16- }
17- } catch ( e ) {
18- console . error ( 'Invalid backend' ) ;
19- } finally {
20- return {
21- path : 'https://nfegdyrzrdhwvqpujxhj.functions.supabase.co' ,
22- headers : {
23- 'Authorization' : 'Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJyb2xlIjoiYW5vbiIsImlhdCI6MTY0MzY2MTc3MCwiZXhwIjoxOTU5MjM3NzcwfQ.x_SvsnLkgYNEgpxa7h74Z__aBgGbGIYVmljhwYDJ1Bc'
24- }
25- } ;
26- }
10+ return localStorage . getItem ( 'backend' ) ?? 'https://backend.algorithmic.games' ;
2711 }
2812 static isOverride ( ) {
2913 return localStorage . getItem ( 'backend' ) !== null ;
You can’t perform that action at this time.
0 commit comments