File tree Expand file tree Collapse file tree 4 files changed +8
-3
lines changed Expand file tree Collapse file tree 4 files changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ export const Sponsors: React.FunctionComponent<ISponsorsProps> = (props: React.P
14
14
15
15
useEffect ( ( ) => {
16
16
const getSponsors = async ( ) => {
17
- const response = await fetch ( `${ CONFIG . urls . api } / api/ sponsors` ) ;
17
+ const response = await fetch ( `${ CONFIG . urls . api } ${ CONFIG . api . sponsors } ` ) ;
18
18
19
19
if ( ! response . ok ) {
20
20
setIndividuals ( null ) ;
Original file line number Diff line number Diff line change @@ -5,6 +5,11 @@ export const CONFIG = {
5
5
preview : "https://cloudflare.front-matter-docs.pages.dev" ,
6
6
local : "http://localhost:3000" ,
7
7
} ,
8
+ api : {
9
+ sponsors : "/sponsors" ,
10
+ stats : "/stats" ,
11
+ stars : "/stars" ,
12
+ } ,
8
13
environment : process . env . NEXT_PUBLIC_VERCEL_ENV ,
9
14
github : {
10
15
token : process . env . GITHUB_AUTH ,
Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ const Charts = () => {
16
16
const [ stats , setStats ] = useState < Analytics | null > ( null ) ;
17
17
18
18
const getStats = async ( ) => {
19
- const res = await fetch ( `${ CONFIG . urls . api } / api/ stats` ) ;
19
+ const res = await fetch ( `${ CONFIG . urls . api } ${ CONFIG . api . stats } ` ) ;
20
20
const json = await res . json ( ) ;
21
21
setStats ( json ) ;
22
22
} ;
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ export class StarService {
10
10
}
11
11
12
12
if ( ! StarService . starCaller ) {
13
- StarService . starCaller = fetch ( `${ CONFIG . urls . api } / api/ stars` ) ;
13
+ StarService . starCaller = fetch ( `${ CONFIG . urls . api } ${ CONFIG . api . stars } ` ) ;
14
14
}
15
15
16
16
const response = await StarService . starCaller ;
You can’t perform that action at this time.
0 commit comments