Skip to content
This repository has been archived by the owner on Jan 20, 2024. It is now read-only.

Commit

Permalink
Set the default mimetype for all responses
Browse files Browse the repository at this point in the history
  • Loading branch information
tdemin committed Apr 4, 2020
1 parent 53a541c commit 3cafcdb
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions project_amber/app.py
@@ -1,6 +1,7 @@
from json import dumps

from flask import Flask
from flask.wrappers import Response
from flask_cors import CORS

from project_amber.config import config
Expand All @@ -13,8 +14,13 @@
from project_amber.handlers.task import task_handlers as task
from project_amber.handlers.users import user_handlers as user

class JsonResponse(Response):
default_mimetype = "application/json"
charset = "utf-8"

app = Flask(__name__)
app.config["SQLALCHEMY_DATABASE_URI"] = config.database
app.response_class = JsonResponse
db.init_app(app)
CORS(app, resources={r"/*": {"origins": config.domain}})

Expand Down

0 comments on commit 3cafcdb

Please sign in to comment.