sanic compliance
This commit is contained in:
parent
2cbd4e96b8
commit
feff70415f
4 changed files with 6 additions and 5 deletions
|
@ -64,7 +64,7 @@ def get_comments_count(request):
|
|||
def new_comment(request):
|
||||
|
||||
try:
|
||||
data = request.get_json()
|
||||
data = request.json
|
||||
logger.info(data)
|
||||
|
||||
# validate token: retrieve site entity
|
||||
|
|
|
@ -20,6 +20,6 @@ def new_mail(request):
|
|||
|
||||
except:
|
||||
logger.exception("new mail failure")
|
||||
abort(400)
|
||||
return response.text('BAD_REQUEST', status=400)
|
||||
|
||||
return "OK"
|
||||
return response.text('OK')
|
||||
|
|
|
@ -59,7 +59,7 @@ processor.start(template_path)
|
|||
logger.info("Start Stacosys application")
|
||||
|
||||
# enable CORS
|
||||
cors = CORS(app, resources={r"/comments/*": {"origins": "*"}})
|
||||
cors = CORS(app, resources={r"/comments/*": {"origins": config.CORS_ORIGIN}})
|
||||
|
||||
# tune logging level
|
||||
if not config.DEBUG:
|
||||
|
|
|
@ -11,7 +11,8 @@ MAIL_URL = "http://localhost:8025/mbox"
|
|||
|
||||
HTTP_ADDRESS = "0.0.0.0"
|
||||
HTTP_PORT = 8000
|
||||
HTTP_WORKERS = 4
|
||||
HTTP_WORKERS = 1
|
||||
CORS_ORIGIN = "*"
|
||||
|
||||
SALT = "BRRJRqXgGpXWrgTidBPcixIThHpDuKc0"
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue