Skip to content

Instantly share code, notes, and snippets.

@developer-rakeshpaul
Forked from kacieh80/app.py
Created May 7, 2016 06:20
Show Gist options
  • Save developer-rakeshpaul/a7e7108f5d08fad56371e152e9d15a72 to your computer and use it in GitHub Desktop.
Save developer-rakeshpaul/a7e7108f5d08fad56371e152e9d15a72 to your computer and use it in GitHub Desktop.
Falcon App start up file with Flask like routes
import falcon
import os
from app.db import db_session
from app.utils.exceptions import build_error_response
from app.startup import (autoload, add_routes)
wsgi_app = falcon.API(after=[db_session.remove_session])
autoload("{0}/{1}".format(os.path.dirname(__file__), "handlers"))
add_routes(wsgi_app)
wsgi_app.add_error_handler(Exception, build_error_response)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment