mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
[enh] Add an argument to start api without WebSocket support
This commit is contained in:
parent
60b555ad76
commit
925cf4b070
1 changed files with 6 additions and 1 deletions
|
@ -36,15 +36,20 @@ if __name__ == '__main__':
|
|||
|
||||
# Additional arguments
|
||||
cache = True
|
||||
websocket = True
|
||||
if '--no-cache' in sys.argv:
|
||||
cache = False
|
||||
sys.argv.remove('--no-cache')
|
||||
if '--no-websocket' in sys.argv:
|
||||
websocket = False
|
||||
sys.argv.remove('--no-websocket')
|
||||
# TODO: Add log argument
|
||||
|
||||
try:
|
||||
# Run the server
|
||||
api(['yunohost'], port=6787,
|
||||
routes={('GET', '/installed'): is_installed}, use_cache=cache)
|
||||
routes={('GET', '/installed'): is_installed},
|
||||
use_cache=cache, use_websocket=websocket)
|
||||
except MoulinetteError as e:
|
||||
from moulinette.interfaces.cli import colorize
|
||||
print('%s %s' % (colorize(m18n.g('error'), 'red'), e.strerror))
|
||||
|
|
Loading…
Add table
Reference in a new issue