Changes between Version 1 and Version 2 of Falcon(webapi)
- Timestamp:
- Mar 9, 2017, 1:42:14 PM (8 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Falcon(webapi)
v1 v2 64 64 とこんな感じで、新しいサーバサイドの構成を考えています。 65 65 tinydbやmongodbを組み込めば、dbの中身をそのまま返せますね。 66 67 68 example.py 69 70 {{{ 71 import json 72 import falcon 73 74 75 class HelloResource(object): 76 77 def on_get(self, req, resp): 78 msg = { 79 "message": "Welcome to the Falcon" 80 } 81 resp.body = json.dumps(msg) 82 83 app = falcon.API() 84 app.add_route("/", HelloResource()) 85 86 87 if __name__ == "__main__": 88 from wsgiref import simple_server 89 httpd = simple_server.make_server("127.0.0.1", 8000, app) 90 httpd.serve_forever() 91 }}} 66 92 67 93 = tinydb =