1
0
mirror of https://github.com/enpaul/kodak.git synced 2024-09-21 08:13:54 +00:00
kodak/dehance/application.py

23 lines
637 B
Python
Raw Normal View History

2020-09-22 03:23:47 +00:00
import flask_restful
2021-05-02 22:12:04 +00:00
from dehance import resources
from dehance._server import DehanceFlask
from dehance._server import initialize_database
from dehance._server import make_the_tea
2020-09-22 03:23:47 +00:00
2021-05-02 22:12:04 +00:00
APPLICATION = DehanceFlask(__name__)
2020-09-22 03:23:47 +00:00
API = flask_restful.Api(APPLICATION, catch_all_404s=True)
def _set_upload_limit() -> None:
APPLICATION.config["MAX_CONTENT_LENGTH"] = APPLICATION.appconfig.upload.size_limit
APPLICATION.before_request(make_the_tea)
APPLICATION.before_first_request(initialize_database)
APPLICATION.before_first_request(_set_upload_limit)
for resource in resources.RESOURCES:
API.add_resource(resource, *resource.routes)