Skip to content

Commit

Permalink
Add Chapter One, Lecture 3 demo files
Browse files Browse the repository at this point in the history
  • Loading branch information
Tim Berry committed May 30, 2019
1 parent c5736d6 commit bee9e8b
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Chapter_One/Lecture_3_Demo/myapp/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
FROM python:3.5

COPY . /app
WORKDIR /app

RUN pip install -r requirements.txt

CMD ["python", "-u", "server.py"]
1 change: 1 addition & 0 deletions Chapter_One/Lecture_3_Demo/myapp/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
tornado
21 changes: 21 additions & 0 deletions Chapter_One/Lecture_3_Demo/myapp/server.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import tornado.ioloop
import tornado.web


class MainHandler(tornado.web.RequestHandler):
def get(self):
self.write("Hello, world\n")
print(self.request)


def make_app():
return tornado.web.Application([
(r"/", MainHandler),
])


if __name__ == "__main__":
app = make_app()
app.listen(8888)
tornado.ioloop.IOLoop.current().start()

0 comments on commit bee9e8b

Please sign in to comment.