|
|
|
@ -3,7 +3,11 @@ from molten import App, Route, ResponseRendererMiddleware, Settings
|
|
|
|
|
from molten.http import HTTP_404, Request
|
|
|
|
|
from molten.openapi import Metadata, OpenAPIHandler, OpenAPIUIHandler
|
|
|
|
|
from molten.settings import SettingsComponent
|
|
|
|
|
from molten.contrib.sqlalchemy import SQLAlchemyMiddleware, SQLAlchemyEngineComponent, SQLAlchemySessionComponent
|
|
|
|
|
from molten.contrib.sqlalchemy import (
|
|
|
|
|
SQLAlchemyMiddleware,
|
|
|
|
|
SQLAlchemyEngineComponent,
|
|
|
|
|
SQLAlchemySessionComponent,
|
|
|
|
|
)
|
|
|
|
|
from wsgicors import CORS
|
|
|
|
|
from whitenoise import WhiteNoise
|
|
|
|
|
|
|
|
|
@ -15,9 +19,7 @@ from . import settings
|
|
|
|
|
|
|
|
|
|
get_schema = OpenAPIHandler(
|
|
|
|
|
metadata=Metadata(
|
|
|
|
|
title="gears_api",
|
|
|
|
|
description="API for the gears application",
|
|
|
|
|
version="0.0.0"
|
|
|
|
|
title="gears_api", description="API for the gears application", version="0.0.0"
|
|
|
|
|
)
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
@ -73,7 +75,7 @@ def create_app(_components=None, _middleware=None, _routes=None, _renderers=None
|
|
|
|
|
components=_components or components,
|
|
|
|
|
middleware=_middleware or middleware,
|
|
|
|
|
routes=_routes or routes,
|
|
|
|
|
renderers=_renderers or renderers
|
|
|
|
|
renderers=_renderers or renderers,
|
|
|
|
|
)
|
|
|
|
|
wrapped_app = CORS(wrapped_app, **settings.strict_get("wsgicors"))
|
|
|
|
|
wrapped_app = WhiteNoise(wrapped_app, **settings.strict_get("whitenoise"))
|
|
|
|
|