Created
May 20, 2017 07:04
-
-
Save dungvtdev/fc45f50e6d2663133d9a4e7ba5b5a774 to your computer and use it in GitHub Desktop.
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 | |
myhost = os.uname()[1] | |
def app(environ, start_response): | |
start_response('200 OK', [('Content-Type', 'text/html')]) | |
#return [b'Hello, world!'] | |
return myhost | |
if __name__ == '__main__': | |
try: | |
from wsgiref.simple_server import make_server | |
httpd = make_server('', 8888, app) | |
print('Serving on port 8080...') | |
httpd.serve_forever() | |
except KeyboardInterrupt: | |
print('Goodbye.') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment