From d40adfc62ee5e483542f8562542d64716b13d220 Mon Sep 17 00:00:00 2001 From: Andros Fenollosa Date: Sat, 20 Jan 2018 00:37:59 +0100 Subject: [PATCH] skeleton app --- Pipfile | 18 ++++++++++++++++++ app.py | 59 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 77 insertions(+) create mode 100644 Pipfile create mode 100644 app.py diff --git a/Pipfile b/Pipfile new file mode 100644 index 0000000..dc5f052 --- /dev/null +++ b/Pipfile @@ -0,0 +1,18 @@ +[[source]] + +url = "https://pypi.python.org/simple" +verify_ssl = true +name = "pypi" + + +[dev-packages] + + + +[packages] + +flask = "*" +flask-restplus = "*" +flask-jwt = "*" +flask-sqlalchemy = "*" +flask-mail = "*" diff --git a/app.py b/app.py new file mode 100644 index 0000000..78f238e --- /dev/null +++ b/app.py @@ -0,0 +1,59 @@ +from flask import Flask +from flask_restplus import Resource, Api + +app = Flask(__name__) +api = Api(app) +PRE_URL = '/api/v1/' + + +@api.route(PRE_URL + 'signup') +class Signup(Resource): + + def post(self): + return {'hello': 'world'} + + +@api.route(PRE_URL + 'login') +class Login(Resource): + + def post(self): + return {'hello': 'world'} + + +@api.route(PRE_URL + 'login') +class Logout(Resource): + + def get(self): + return {'hello': 'world'} + + +@api.route(PRE_URL + 'news') +class News(Resource): + + def get(self): + return {'hello': 'world'} + + def post(self): + return {'hello': 'world'} + + +@api.route(PRE_URL + 'news/') +class News_single(Resource): + + def get(self, id): + return {'hello': id} + + +@api.route(PRE_URL + 'news//comments') +class Comments(Resource): + + def get(self, id): + return {'hello': 'world'} + + def post(self, id): + return {'hello': 'world'} + + +if __name__ == '__main__': + app.run(debug=True) +