init
This commit is contained in:
0
app/__init__.py
Normal file
0
app/__init__.py
Normal file
7
app/app.py
Normal file
7
app/app.py
Normal file
@@ -0,0 +1,7 @@
|
||||
import falcon
|
||||
|
||||
from .images import Resource
|
||||
|
||||
app = application = falcon.App()
|
||||
|
||||
app.add_route('/images', Resource())
|
18
app/images.py
Normal file
18
app/images.py
Normal file
@@ -0,0 +1,18 @@
|
||||
import falcon
|
||||
import msgpack
|
||||
|
||||
|
||||
class Resource:
|
||||
|
||||
def on_get(self, req, resp):
|
||||
doc = {
|
||||
'images': [
|
||||
{
|
||||
'href': '/images/1eaf6ef1-7f2d-4ecc-a8d5-6e8adba7cc0e.png',
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
resp.data = msgpack.packb(doc, use_bin_type=True)
|
||||
resp.content_type = falcon.MEDIA_MSGPACK
|
||||
resp.status = falcon.HTTP_200
|
Reference in New Issue
Block a user