File tree Expand file tree Collapse file tree 8 files changed +13
-135
lines changed Expand file tree Collapse file tree 8 files changed +13
-135
lines changed Load Diff Large diffs are not rendered by default.
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 . apiUrl } /api/sponsors` ) ;
17
+ const response = await fetch ( `${ CONFIG . urls . api } /api/sponsors` ) ;
18
18
19
19
if ( ! response . ok ) {
20
20
setIndividuals ( null ) ;
Original file line number Diff line number Diff line change 1
1
export const CONFIG = {
2
- apiUrl : "https://fontmatter-fncs.azurewebsites.net" ,
3
- environment : process . env . NEXT_PUBLIC_VERCEL_ENV ,
4
- openAi : {
5
- token : process . env . OPENAI_TOKEN ,
2
+ urls : {
3
+ api : process . env . NEXT_PUBLIC_API_URL ,
4
+ production : "https://frontmatter.codes" ,
5
+ preview : process . env . CF_PAGES_URL ,
6
+ local : "http://localhost:3000" ,
6
7
} ,
8
+ environment : process . env . NEXT_PUBLIC_VERCEL_ENV ,
7
9
github : {
8
10
token : process . env . GITHUB_AUTH ,
9
11
} ,
Original file line number Diff line number Diff line change @@ -2,10 +2,10 @@ import { CONFIG } from "../constants";
2
2
3
3
export function publicUrl ( ) {
4
4
if ( CONFIG . environment === "production" ) {
5
- return `https://frontmatter.codes` ;
5
+ return CONFIG . urls . production ;
6
6
} else if ( CONFIG . environment === "preview" ) {
7
- return `https://beta.frontmatter.codes` ;
7
+ return CONFIG . urls . preview ;
8
8
} else {
9
- return `http://localhost:3000` ;
9
+ return CONFIG . urls . local ;
10
10
}
11
11
}
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 . apiUrl } /api/stats` ) ;
19
+ const res = await fetch ( `${ CONFIG . urls . api } /api/stats` ) ;
20
20
const json = await res . json ( ) ;
21
21
setStats ( json ) ;
22
22
} ;
Load Diff This file was deleted.
Load Diff This file was deleted.
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 . apiUrl } /api/stars` ) ;
13
+ StarService . starCaller = fetch ( `${ CONFIG . urls . api } /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