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