Last active
          June 27, 2017 09:46 
        
      - 
      
 - 
        
Save timothycrosley/7bde155d92922449acf5 to your computer and use it in GitHub Desktop.  
    Seamlessly switch how communication happens
  
        
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | import os | |
| import hug | |
| import my_internal_hug_microservice | |
| if os.environ.get('API_INTERFACE', None) == 'HTTP':: | |
| internal_hug_microservice = hug.use.HTTP('http://localhost:8000/') | |
| else: | |
| internal_hug_microservice = hug.use.Local(my_internal_hug_microservice) | |
| latest = my_internal_microservice.get('/latest_news').data | 
It looks wrong. There are two columns at the end of line no. 7.
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment
  
            
Is this correct? internal_hug_microservice is declared on lines 8 and 10 but not used anywhere and my_internal_microservice does not seem be declared anywhere?