swingmusic/server/app/__init__.py
geoffrey45 7e67b819f0 major changes:
- introduce flask cache
- use replaceAll together with encodeURI component on client
- many more
2021-12-19 13:27:37 +03:00

24 lines
407 B
Python

from flask import Flask
from flask_cors import CORS
from flask_caching import Cache
config = {
"CACHE_TYPE": "SimpleCache",
"CACHE_DEFAULT_TIMEOUT": 300
}
cache = Cache(config = config)
def create_app():
app = Flask(__name__)
CORS(app)
app.config.from_mapping(config)
cache.init_app(app)
from . import api
app.register_blueprint(api.bp, url_prefix='/')
return app