30 lines
935 B
Python
30 lines
935 B
Python
from pyramid.config import Configurator
|
|
|
|
|
|
def main(global_config, **settings):
|
|
""" This function returns a Pyramid WSGI application.
|
|
"""
|
|
config = Configurator(settings=settings)
|
|
config.include('pyramid_chameleon')
|
|
config.add_static_view('static', 'static', cache_max_age=3600)
|
|
config.add_route('home', '/')
|
|
|
|
|
|
#
|
|
# Hello world test endpoint.
|
|
# If ?auth=true is passed then it will run OAuth validation on the request.
|
|
#
|
|
config.add_route('hello', '/v{version}/hello.json')
|
|
|
|
#
|
|
# Action endpoints
|
|
# All action endpoints follow the same convention.
|
|
# Everything in []'s are optional
|
|
# /action/{id}[/{additional}].json
|
|
config.add_route('view', '/v{version}/action/{id}/view.json')
|
|
config.add_route('delete', '/v{version}/action/{id}/delete.json')
|
|
config.add_route('create', '/v{version}/action/{id}/create.json')
|
|
|
|
config.scan()
|
|
return config.make_wsgi_app()
|