Skip to content
This repository was archived by the owner on Jan 19, 2023. It is now read-only.

Commit 0f8706e

Browse files
committed
Add two more examples
1 parent ac92320 commit 0f8706e

File tree

5 files changed

+45
-0
lines changed

5 files changed

+45
-0
lines changed

datasette-native/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Datasette (native)
2+
3+
Uses [Datasette](https://datasette.readthedocs.io) directly using the [`datasette publish cloudrun` command](https://datasette.readthedocs.io/en/stable/publish.html#publishing-to-google-cloud-run).

tornado-native/Dockerfile

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
FROM python:slim
2+
3+
ENV APP_HOME /app
4+
ENV PORT 8080
5+
ENV PYTHONUNBUFFERED 1
6+
EXPOSE $PORT
7+
WORKDIR $APP_HOME
8+
9+
COPY . .
10+
11+
RUN pip install --upgrade pip
12+
RUN pip install -r requirements.txt
13+
14+
CMD exec python app.py

tornado-native/README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Tornado (native)
2+
3+
[![Run on Google Cloud](https://deploy.cloud.run/button.svg)](https://deploy.cloud.run)
4+
5+
Uses [Tornado](https://www.tornadoweb.org/), using it's integrated HTTP Server (which is not WSGI)
6+
7+
[![deployment status badge](https://admin-ebpumwrniq-uc.a.run.app/status/tornado-native.svg)](https://tornado-native-ebpumwrniq-uc.a.run.app/)

tornado-native/app.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import os
2+
3+
import tornado.ioloop
4+
import tornado.web
5+
6+
port = os.environ.get('PORT', 8080)
7+
8+
class MainHandler(tornado.web.RequestHandler):
9+
def get(self):
10+
self.write("Hello, from Tornado")
11+
12+
def make_app():
13+
return tornado.web.Application([
14+
(r"/", MainHandler),
15+
])
16+
17+
if __name__ == "__main__":
18+
app = make_app()
19+
app.listen(port)
20+
tornado.ioloop.IOLoop.current().start()

tornado-native/requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
tornado

0 commit comments

Comments
 (0)