Add ASGI app wrapper

This commit is contained in:
Lance Edgar 2023-01-02 16:47:50 -06:00
parent 2cdd9d3b72
commit a9a58584bd

View file

@ -3,7 +3,7 @@
Corporal web app Corporal web app
""" """
from tailbone import app from tailbone import app as base
def main(global_config, **settings): def main(global_config, **settings):
@ -16,8 +16,8 @@ def main(global_config, **settings):
'tailbone:templates']) 'tailbone:templates'])
# make config objects # make config objects
rattail_config = app.make_rattail_config(settings) rattail_config = base.make_rattail_config(settings)
pyramid_config = app.make_pyramid_config(settings) pyramid_config = base.make_pyramid_config(settings)
# bring in the rest of Corporal # bring in the rest of Corporal
pyramid_config.include('corporal.web.static') pyramid_config.include('corporal.web.static')
@ -25,3 +25,12 @@ def main(global_config, **settings):
pyramid_config.include('corporal.web.views') pyramid_config.include('corporal.web.views')
return pyramid_config.make_wsgi_app() return pyramid_config.make_wsgi_app()
def asgi_main():
"""
This function returns an ASGI application.
"""
from tailbone.asgi import make_asgi_app
return make_asgi_app(main)