diff --git a/application/__init__.py b/application/__init__.py index da900d0..4a2b19b 100644 --- a/application/__init__.py +++ b/application/__init__.py @@ -12,7 +12,7 @@ app = Flask(__name__) api = Api(app, version='1', contact={"name":""}, license={"name":"Online Dienst Dokumentation"}, api_spec_url='/api/swagger') -api.add_resource(endpoints.PersonList,'/api/v1/person/') +api.add_resource(endpoints.PersonList,'/api/v1/person/', '/api/v1/person/') @app.route("/") def index(): diff --git a/application/endpoints.py b/application/endpoints.py index 1352fa8..725e2b1 100644 --- a/application/endpoints.py +++ b/application/endpoints.py @@ -6,7 +6,7 @@ import json from application.db import Session, Person, Fingerprint class PersonList(Resource): - def post(self, id): + def post(self, id = None): """ """ try: data = "" @@ -15,7 +15,7 @@ class PersonList(Resource): print("error: -", e) return flask.make_response(flask.jsonify({'error': str(e)}), 400) - def get(self, id): + def get(self, id = None): """ """ try: session = Session() @@ -23,7 +23,6 @@ class PersonList(Resource): person = Person(fname="hi", fingerprints=[fingerprint]) session.add(fingerprint) session.add(person) - session.commit() data = list(session.query(Person).all()) @@ -37,7 +36,7 @@ class PersonList(Resource): print("error: -", e) return flask.make_response(flask.jsonify({'error': str(e)}), 400) - def put(self, id): + def put(self, id = None): """ """ try: data = "" @@ -46,7 +45,7 @@ class PersonList(Resource): print("error: -", e) return flask.make_response(flask.jsonify({'error': str(e)}), 400) - def delete(self, id): + def delete(self, id = None): """ """ try: data = "" diff --git a/run.py b/run.py index eacc87a..f644a58 100644 --- a/run.py +++ b/run.py @@ -1,6 +1,6 @@ from application import app -app.run(host="0.0.0.0",port='10024', debug=True) +app.run(host="localhost",port='10024', debug=True) diff --git a/test.sqlite b/test.sqlite index a15cd66..12d8db9 100644 Binary files a/test.sqlite and b/test.sqlite differ