diff --git a/passchecker/commands/web.py b/passchecker/commands/web.py index 95c8c8032e21e4f8ce898304e01139d11b66cb66..e29c8e7dc6f3639ffa1a2022a04dc3e126f3dfd9 100644 --- a/passchecker/commands/web.py +++ b/passchecker/commands/web.py @@ -16,16 +16,19 @@ # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. +import os +import pkg_resources from http.server import HTTPServer from http.server import CGIHTTPRequestHandler from .passcheckerdefaults import PASS_CHECKER_DEFAULTS def server(address=PASS_CHECKER_DEFAULTS['address'], port=PASS_CHECKER_DEFAULTS['port']): + os.chdir(os.path.dirname(__file__)+"/../") server_address = (address, port) server = HTTPServer handler = CGIHTTPRequestHandler - print("Server up and running at: http://{}:{}/cgi-bin/index.py".format(address,port)) + print("Server up and running at: http://{}:{}/cgi-bin/index.py".format(address, port)) httpd = server(server_address, handler) try: