mirror of
https://github.com/Dvorinka/swingmusic-extended.git
synced 2026-06-05 04:53:01 +00:00
major changes:
- introduce flask cache - use replaceAll together with encodeURI component on client - many more
This commit is contained in:
@@ -1,11 +1,22 @@
|
||||
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='/')
|
||||
|
||||
|
||||
Reference in New Issue
Block a user