config CORS for dev
This commit is contained in:
parent
4287766d7f
commit
a2697b8a11
3 changed files with 7 additions and 6 deletions
|
@ -1,7 +1,7 @@
|
|||
from models.User import User, user_schema
|
||||
from models.User import User, user_schema, users_schema
|
||||
|
||||
class UserEndpoint(object):
|
||||
def users():
|
||||
user = User.query.first()
|
||||
response = user_schema.dumps(user)
|
||||
user = User.query.all()
|
||||
response = users_schema.dumps(user)
|
||||
return response
|
||||
|
|
4
app.py
4
app.py
|
@ -10,8 +10,8 @@ from flask_cors import CORS
|
|||
|
||||
def create_app():
|
||||
app = Flask(__name__)
|
||||
CORS(app)
|
||||
|
||||
CORS(app, origins="http://localhost:3004")
|
||||
app.config['CORS_HEADERS'] = 'Content-Type'
|
||||
app.config.from_object(DevelopmentConfig)
|
||||
db.init_app(app)
|
||||
ma.init_app(app)
|
||||
|
|
|
@ -107,6 +107,7 @@ class UserSchema(ma.ModelSchema):
|
|||
fields = (
|
||||
'id',
|
||||
'name',
|
||||
'email',
|
||||
'registered_on',
|
||||
'rank',
|
||||
'rank_certainty',
|
||||
|
|
Loading…
Reference in a new issue