diff --git a/iebank_api/routes.py b/iebank_api/routes.py index f831832..a0cd9ac 100644 --- a/iebank_api/routes.py +++ b/iebank_api/routes.py @@ -9,10 +9,12 @@ def hello_world(): # app.logger.warn('This is a warning log message') # app.logger.error('This is an error message') # app.logger.critical('This is a critical message') + app.logger.debug('Route / called') return 'Hello, World!' @app.route('/skull', methods=['GET']) def skull(): + app.logger.debug('Route /skull GET called') text = 'Hi! This is the BACKEND SKULL! 💀 ' text = text +'
Database URL:' + db.session.bind.url.database if db.session.bind.url.host: @@ -28,6 +30,7 @@ def skull(): @app.route('/accounts', methods=['POST']) def create_account(): + app.logger.debug('Route /accounts POST called') name = request.json['name'] currency = request.json['currency'] account = Account(name, currency) @@ -37,16 +40,19 @@ def create_account(): @app.route('/accounts', methods=['GET']) def get_accounts(): + app.logger.debug('Route /accounts GET') accounts = Account.query.all() return {'accounts': [format_account(account) for account in accounts]} @app.route('/accounts/', methods=['GET']) def get_account(id): + app.logger.debug('Route /accounts GET called with id: ' + id) account = Account.query.get(id) return format_account(account) @app.route('/accounts/', methods=['PUT']) def update_account(id): + app.logger.debug('Route /accounts PUT called with id: ' + id) account = Account.query.get(id) account.name = request.json['name'] db.session.commit() @@ -54,6 +60,7 @@ def update_account(id): @app.route('/accounts/', methods=['DELETE']) def delete_account(id): + app.logger.debug('Route /accounts DELETE called with id: ' + id) account = Account.query.get(id) db.session.delete(account) db.session.commit()