diff --git a/bin/srv.py b/bin/srv.py index 90f95bb..fe5cb25 100644 --- a/bin/srv.py +++ b/bin/srv.py @@ -24,7 +24,7 @@ from flask import Flask, request, send_from_directory, redirect, Response MYDIR = os.path.abspath(os.path.join(__file__, '..', '..')) sys.path.append("%s/lib/" % MYDIR) -from globals import FILE_QUERIES_LOG, LOG_FILE, TEMPLATES, STATIC, MALFORMED_RESPONSE_HTML_PAGE +from globals import FILE_QUERIES_LOG, LOG_FILE, TEMPLATES, STATIC, MALFORMED_RESPONSE_HTML_PAGE, SERVER_ADDRESS, SERVER_PORT from limits import Limits from cheat_wrapper import cheat_wrapper from post import process_post_request @@ -205,5 +205,5 @@ def answer(topic=None): return result return Response(result, mimetype='text/plain') -SRV = WSGIServer(("0.0.0.0", 8002), app) # log=None) +SRV = WSGIServer((SERVER_ADDRESS, SERVER_PORT), app) # log=None) SRV.serve_forever() diff --git a/lib/globals.py b/lib/globals.py index 913ba15..83401f7 100644 --- a/lib/globals.py +++ b/lib/globals.py @@ -1,6 +1,7 @@ """ Global configuration of the project. -All hardcoded paths should be (theoretically) here. +All hardcoded pathes and other data should be +(theoretically) here. """ from __future__ import print_function @@ -11,6 +12,9 @@ from pygments.styles import get_all_styles USE_OS_PACKAGES = True # set to False if you pull cheat sheets repositories from GitHub DOCKERIZED = False # set to True if the service is running in a Docker container +SERVER_ADDRESS = '0.0.0.0' +SERVER_PORT = 8002 + MYDIR = os.path.abspath(os.path.join(__file__, '..', '..')) if DOCKERIZED: