Initial Flask version

This commit is contained in:
Gergely Polonkai 2016-10-25 18:14:11 +02:00
commit 25bc373a3e
3 changed files with 26 additions and 0 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
/venv/

23
api.py Normal file
View File

@ -0,0 +1,23 @@
# -*- coding: utf-8
from flask import Flask
from flask_restful import Resource, Api, reqparse
app = Flask(__name__)
api = Api(app)
parser = reqparse.RequestParser()
parser.add_argument('task')
class HelloWorld(Resource):
def get(self):
return {"hello": "world"}
def post(self):
print(parser.parse_args())
return {'hello': 'world'}
api.add_resource(HelloWorld, '/')
if __name__ == '__main__':
app.run(debug=True)

2
requirements.txt Normal file
View File

@ -0,0 +1,2 @@
Flask==0.11.1
Flask-RESTful==0.3.5