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 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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It looks wrong. There are two columns at the end of line no. 7.