v2 Standalone Docker Update #40
@ -22,7 +22,7 @@ def handle_command(command, rest):
|
||||
if command == "!echo":
|
||||
message = "Got payload [%s]" % rest
|
||||
print(message)
|
||||
return flask.make_response("{message:\"%s\"}" % message, 200, {"Content-Type": "application/json"})
|
||||
return flask.make_response("{\"message\":\"%s\"}" % message, 200, {"Content-Type": "application/json"})
|
||||
|
||||
|
||||
@api.route('/api/v1/command', methods=['GET'])
|
||||
@ -37,9 +37,9 @@ def command_check():
|
||||
@api.route('/api/v1/exec', methods=['GET'])
|
||||
def exec_command():
|
||||
if 'command_name' not in request.args:
|
||||
return flask.make_response('{text:"Argument \'command_name\' not in request"}', 400)
|
||||
return flask.make_response('{\"text\":"Argument \'command_name\' not in request"}', 400)
|
||||
if 'rest' not in request.args:
|
||||
return flask.make_response('{text:"Argument \'rest\' not in request"}', 400)
|
||||
return flask.make_response('{\"text\":"Argument \'rest\' not in request"}', 400)
|
||||
|
||||
return handle_command(request.args['command_name'], request.args['rest'])
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user