add cors to server
This commit is contained in:
parent
b52afa59cd
commit
94184f8635
@ -6,7 +6,7 @@ from functools import wraps
|
||||
import dotenv
|
||||
import jwt
|
||||
from sanic import Sanic, Unauthorized, json as jsonr
|
||||
from sanic_ext import validate
|
||||
from sanic_ext import validate, Extend
|
||||
from sanic_ext.extensions.openapi import openapi
|
||||
from sanic_ext.extensions.openapi.definitions import RequestBody
|
||||
from sanic_redis import SanicRedis
|
||||
@ -19,9 +19,12 @@ api_secret = os.environ['API_SECRET']
|
||||
api_auth = json.loads(os.environ['API_AUTH'])
|
||||
|
||||
app = Sanic('e621_bot_api')
|
||||
app.config.CORS_ORIGINS = '*'
|
||||
app.config.update({
|
||||
'REDIS': 'redis://localhost',
|
||||
})
|
||||
Extend(app)
|
||||
|
||||
|
||||
redis = SanicRedis()
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user