コード例 #1
0
ファイル: __init__.py プロジェクト: BasementCat/scheduleparty
def get_app():
    main_app = Bottle()

    from views.api.v1.user import app as api_v1_user_app
    from views.api.v1.organization import app as api_v1_organization_app

    apps = [
        [api_v1_user_app, '/v1.0/user'],
        [api_v1_organization_app, '/v1.0/organization'],
    ]

    plugins = [JsonResponsePlugin()]

    setup(
        main_app,
        sub_apps=apps,
        plugins=plugins,
        error_handler_generators=[JsonResponsePlugin.getErrorHandler],
    )

    return main_app
コード例 #2
0
ファイル: fruitstand.py プロジェクト: BasementCat/fruitstand
import bottle
from bottle import Bottle, static_file, view, run, debug

from bottleutils.apps import setup

# TODO: import apps as individual apps

app = Bottle()

apps = [
    # [app module, app mountpoint],
]

plugins = []

setup(app, apps, plugins)

# TODO: needs to handle screen assets
# @app.route('/assets/<filen:path>')
# def static_files(filen):
#     return static_file(filen, root = os.path.join(os.path.dirname(__file__), "assets"))

# @app.route('')
# @app.route('/')
# @view('index.html')
# def index():
#     # Since we don't actually have a real use for the home page, redirect to events
#     return bottle.redirect('/event/')
#     # Someday we'll maybe have real content here
#     return {}
コード例 #3
0
ファイル: fruitstand.py プロジェクト: rajansg/fruitstand
import bottle
from bottle import Bottle, static_file, view, run, debug

from bottleutils.apps import setup

# TODO: import apps as individual apps

app = Bottle()

apps = [
    # [app module, app mountpoint],
]

plugins = []

setup(app, apps, plugins)

# TODO: needs to handle screen assets
# @app.route('/assets/<filen:path>')
# def static_files(filen):
#     return static_file(filen, root = os.path.join(os.path.dirname(__file__), "assets"))

# @app.route('')
# @app.route('/')
# @view('index.html')
# def index():
#     # Since we don't actually have a real use for the home page, redirect to events
#     return bottle.redirect('/event/')
#     # Someday we'll maybe have real content here
#     return {}