This commit is contained in:
Inex Code 2022-06-24 20:25:49 +03:00
parent 07e723dec8
commit c6a3588e33
2 changed files with 16 additions and 12 deletions

View file

@ -8,6 +8,7 @@ from flask import Flask, request, jsonify
from flask_restful import Api
from flask_swagger import swagger
from flask_swagger_ui import get_swaggerui_blueprint
from flask_cors import CORS
from strawberry.flask.views import AsyncGraphQLView
@ -34,6 +35,7 @@ def create_app(test_config=None):
"""Initiate Flask app and bind routes"""
app = Flask(__name__)
api = Api(app)
CORS(app)
if test_config is None:
app.config["ENABLE_SWAGGER"] = os.environ.get("ENABLE_SWAGGER", "0")

View file

@ -1,23 +1,24 @@
{ pkgs ? import <nixpkgs> {} }:
let
sp-python = pkgs.python39.withPackages (p: with p; [
flask
flask-restful
setuptools
portalocker
flask-swagger
flask-swagger-ui
pytz
pytest
pytest-mock
pytest-datadir
huey
flask
flask-restful
setuptools
portalocker
flask-swagger
flask-swagger-ui
pytz
pytest
pytest-mock
pytest-datadir
huey
gevent
mnemonic
coverage
pylint
pydantic
typing-extensions
flask-cors
(buildPythonPackage rec {
pname = "strawberry-graphql";
version = "0.114.5";
@ -34,6 +35,7 @@ let
pydantic
pygments
poetry
flask-cors
];
src = fetchPypi {
inherit pname version;
@ -51,4 +53,4 @@ pkgs.mkShell {
PYTHONPATH=${sp-python}/${sp-python.sitePackages}
# maybe set more env-vars
'';
}
}