File tree Expand file tree Collapse file tree 2 files changed +21
-5
lines changed Expand file tree Collapse file tree 2 files changed +21
-5
lines changed Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ class Home extends React.Component {
1414  constructor ( props )  { 
1515    super ( props ) ; 
1616    let  username  =  "akashraj9828" ; 
17-     try  { 
17+     try  {   
1818      username  =  props . match . params . username 
1919        ? props . match . params . username 
2020        : "akashraj9828" ; 
Original file line number Diff line number Diff line change 11// const API_BASE_URL_PROD = "https://gitstats-api-prod.herokuapp.com/"; 
22const  API_BASE_URL_PROD  =  "https://api.gitstats.me/" ; 
33const  API_BASE_URL_DEV  =  "https://gitstats-api-stage.herokuapp.com/" ; 
4- const  API_BASE_URL =  process . env . NODE_ENV  ===  'production'  ? API_BASE_URL_PROD  : API_BASE_URL_DEV ; 
5- const  SENTRY_URL = "https://f32dcf786d96407dae5c787a38d5b88d@o380288.ingest.sentry.io/5209222" ; 
6- const  GA_CODE = "UA-132223767-1" 
7- const  NODE_ENV = process . env . NODE_ENV 
4+ // default use dev api endpoint 
5+ let  API_BASE_URL  =  API_BASE_URL_DEV ; 
6+ // if production set production api 
7+ if  ( process . env . NODE_ENV  ===  "production" )  { 
8+     API_BASE_URL  =  API_BASE_URL_PROD 
9+ } 
10+ 
11+ // if CUSTOM_API env variable set overwrite all 
12+ // for heroku deployments 
13+ try  { 
14+     if ( process . env . CUSTOM_API ) { 
15+         API_BASE_URL = process . env . CUSTOM_API 
16+     } 
17+ }  catch  ( error )  { 
18+     console . log ( error ) ;    
19+ } 
20+ 
21+ const  SENTRY_URL  =  "https://f32dcf786d96407dae5c787a38d5b88d@o380288.ingest.sentry.io/5209222" ; 
22+ const  GA_CODE  =  "UA-132223767-1" 
23+ const  NODE_ENV  =  process . env . NODE_ENV 
824export  default  { 
925    API_BASE_URL_PROD , 
1026    API_BASE_URL_DEV , 
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments