Browse Source

First commit

master
Chimo 1 year ago
commit
077f613c24
4 changed files with 36 additions and 0 deletions
  1. +2
    -0
      .gitignore
  2. +6
    -0
      requirements.txt
  3. +18
    -0
      sample.py
  4. +10
    -0
      uwsgi.ini

+ 2
- 0
.gitignore View File

@@ -0,0 +1,2 @@
__pycache__
venv

+ 6
- 0
requirements.txt View File

@@ -0,0 +1,6 @@
-e git+https://github.com/jarondl/pygtfs@d3b4727d8475b68b8ad41eb32ab26f0ce458c390#egg=pygtfs
falcon==1.4.1
uWSGI==2.0.17.1

# ???
psycopg2==2.7.6.1

+ 18
- 0
sample.py View File

@@ -0,0 +1,18 @@
import falcon

class QuoteResource:
def on_get(self, req, resp):
"""Handles GET requests"""
quote = {
'quote': (
"I've always been more interested in "
"the future than in the past."
),
'author': 'Grace Hopper'
}

resp.media = quote

api = falcon.API()
api.add_route('/quote', QuoteResource())


+ 10
- 0
uwsgi.ini View File

@@ -0,0 +1,10 @@
[uwsgi]
# TODO: use ccoket and uwsgi_pass from nginx
#socket = 0.0.0.0:9090
http = 0.0.0.0:9090
callable = api
wsgi-file = sample.py
processes = 4
threads = 2
stats = 127.0.0.1:9191


Loading…
Cancel
Save