Renamed config to configuration in httpserver URL.
This commit is contained in:
parent
2dbc971275
commit
0c40b51caf
2 changed files with 4 additions and 2 deletions
|
|
@ -108,6 +108,8 @@ def main():
|
||||||
logger.error(str('[uplink] configuration error: {0}'.format(err)))
|
logger.error(str('[uplink] configuration error: {0}'.format(err)))
|
||||||
sys.exit(1)
|
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('_hostname', socket.gethostname())
|
||||||
|
|
||||||
configuration.set_env_var('__version__', __version__)
|
configuration.set_env_var('__version__', __version__)
|
||||||
|
|
|
||||||
|
|
@ -39,7 +39,7 @@ class HTTPServer:
|
||||||
return 'Hello world!'
|
return 'Hello world!'
|
||||||
|
|
||||||
@cherrypy.expose
|
@cherrypy.expose
|
||||||
def config(self):
|
def configuration(self):
|
||||||
return '<!DOCTYPE html><html><head><title>[uplink@' + \
|
return '<!DOCTYPE html><html><head><title>[uplink@' + \
|
||||||
self.__configuration.get_env_var("_hostname") + '] configuration</title><meta ' + \
|
self.__configuration.get_env_var("_hostname") + '] configuration</title><meta ' + \
|
||||||
'http-equiv="refresh" content="60"></head><body><pre ' + \
|
'http-equiv="refresh" content="60"></head><body><pre ' + \
|
||||||
|
|
@ -59,7 +59,7 @@ class HTTPServer:
|
||||||
'tools.response_headers.on': True,
|
'tools.response_headers.on': True,
|
||||||
'tools.response_headers.headers': [('Content-Type', 'text/plain')],
|
'tools.response_headers.headers': [('Content-Type', 'text/plain')],
|
||||||
},
|
},
|
||||||
'/config': {
|
'/configuration': {
|
||||||
# 'request.dispatch': cherrypy.dispatch.MethodDispatcher(),
|
# 'request.dispatch': cherrypy.dispatch.MethodDispatcher(),
|
||||||
'tools.response_headers.on': True,
|
'tools.response_headers.on': True,
|
||||||
'tools.response_headers.headers': [('Content-Type', 'text/html')],
|
'tools.response_headers.headers': [('Content-Type', 'text/html')],
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue