Renamed config to configuration in httpserver URL.

This commit is contained in:
Johannes Findeisen 2022-09-09 00:20:03 +02:00
commit 0c40b51caf
2 changed files with 4 additions and 2 deletions

View file

@ -108,6 +108,8 @@ def main():
logger.error(str('[uplink] configuration error: {0}'.format(err)))
sys.exit(1)
# To be more cross-platform compatible maybe changes are needed:
# https://stackoverflow.com/questions/4271740/how-can-i-use-python-to-get-the-system-hostname
configuration.set_env_var('_hostname', socket.gethostname())
configuration.set_env_var('__version__', __version__)

View file

@ -39,7 +39,7 @@ class HTTPServer:
return 'Hello world!'
@cherrypy.expose
def config(self):
def configuration(self):
return '<!DOCTYPE html><html><head><title>[uplink@' + \
self.__configuration.get_env_var("_hostname") + '] configuration</title><meta ' + \
'http-equiv="refresh" content="60"></head><body><pre ' + \
@ -59,7 +59,7 @@ class HTTPServer:
'tools.response_headers.on': True,
'tools.response_headers.headers': [('Content-Type', 'text/plain')],
},
'/config': {
'/configuration': {
# 'request.dispatch': cherrypy.dispatch.MethodDispatcher(),
'tools.response_headers.on': True,
'tools.response_headers.headers': [('Content-Type', 'text/html')],