We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1dff390 commit 4ec9ad8Copy full SHA for 4ec9ad8
2 files changed
py3/web/do_wsgi.py
@@ -0,0 +1,11 @@
1
+#!/usr/bin/env python3
2
+# -*- coding: utf-8 -*-
3
+
4
+from wsgiref.simple_server import make_server
5
6
+from hello import application
7
8
+httpd = make_server('', 8000, application)
9
+print('Serving HTTP on port 8000...')
10
11
+httpd.serve_forever()
py3/web/hello.py
@@ -0,0 +1,7 @@
+def application(environ, start_response):
+ start_response('200 OK', [('Content-Type', 'text/html')])
+ body = '<h1>Hello, %s!</h1>' % (environ['PATH_INFO'][1:] or 'web')
+ return [body.encode('utf-8')]
0 commit comments