2020-09-22 03:23:47 +00:00
|
|
|
import flask_restful
|
|
|
|
|
2021-10-28 23:03:09 +00:00
|
|
|
from fresnel_lens import resources
|
2021-10-29 03:07:13 +00:00
|
|
|
from fresnel_lens._server import FresnelFlask
|
2021-10-28 23:03:09 +00:00
|
|
|
from fresnel_lens._server import initialize_database
|
|
|
|
from fresnel_lens._server import make_the_tea
|
2020-09-22 03:23:47 +00:00
|
|
|
|
|
|
|
|
2021-10-29 03:07:13 +00:00
|
|
|
APPLICATION = FresnelFlask(__name__)
|
2020-09-22 03:23:47 +00:00
|
|
|
API = flask_restful.Api(APPLICATION, catch_all_404s=True)
|
|
|
|
|
|
|
|
|
|
|
|
APPLICATION.before_request(make_the_tea)
|
|
|
|
APPLICATION.before_first_request(initialize_database)
|
|
|
|
|
|
|
|
for resource in resources.RESOURCES:
|
|
|
|
API.add_resource(resource, *resource.routes)
|