Files
cellxgene/server/app/app.py
Bruce Martin 57c4e9ff33 Flatbuffer cleanup (#598)
* dead code and route removal

* more dead code cleanup

* fix scanpy_engine tests

* lint

* add missing catch in filter parsing

* update scanpy NaN tests

* more fbs tests and dead test removal

* remove forced default for content type negotiation

* bit of cleanup

* more fbs test cleanup

* lint

* remove swagger

* swagger cleanup

* lint

* correctly handle lack of templates

* more dead code removal

* remove unused files

* fix dev build

* lint
2019-02-19 08:50:29 -08:00

32 lines
779 B
Python

import os
from flask import Flask
from flask_caching import Cache
from flask_compress import Compress
from flask_cors import CORS
from .rest_api.rest import get_api_resources
from .util.utils import Float32JSONEncoder
from .web import webapp
REACTIVE_LIMIT = 1_000_000
app = Flask(__name__, static_folder="web/static")
app.json_encoder = Float32JSONEncoder
cache = Cache(app, config={"CACHE_TYPE": "simple", "CACHE_DEFAULT_TIMEOUT": 860_000})
Compress(app)
CORS(app)
# Config
SECRET_KEY = os.environ.get("CXG_SECRET_KEY", default="SparkleAndShine")
app.config.update(SECRET_KEY=SECRET_KEY)
# Application Data
data = None
resources = get_api_resources()
app.register_blueprint(webapp.bp)
app.register_blueprint(resources.blueprint)
app.add_url_rule("/", endpoint="index")