commit 25bc373a3ecce261b53f228a99dc2e0f3682c570 Author: Gergely Polonkai Date: Tue Oct 25 18:14:11 2016 +0200 Initial Flask version diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..9f21b54 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/venv/ diff --git a/api.py b/api.py new file mode 100644 index 0000000..076df65 --- /dev/null +++ b/api.py @@ -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) diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..33ca2e1 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,2 @@ +Flask==0.11.1 +Flask-RESTful==0.3.5