[+] Requirements.txt

This commit is contained in:
Charles Le Maux 2024-06-20 17:52:23 +01:00
parent cb674ac22a
commit ac330232ed
2 changed files with 9 additions and 5 deletions

10
api.py
View File

@ -1,6 +1,6 @@
from flask import Flask, current_app, make_response, request, jsonify, Response from flask import Flask, current_app, make_response, request, jsonify, Response
from flask_cors import CORS from flask_cors import CORS
from typing import Dict from typing import Dict, Tuple
import generic_executor import generic_executor
import json import json
@ -103,15 +103,15 @@ def update_property() -> Response:
return jsonify({'message': 'OK'}), 200 return jsonify({'message': 'OK'}), 200
@app.route('/Command', methods=['POST']) @app.route('/Command', methods=['POST'])
def command() -> Response: def command() -> tuple[Response, int]:
data: Dict[str, str, str] = request.get_json() data: Dict[str, str, str] = request.get_json()
if not data: if not data:
return jsonify({"error": "No JSON payload"}), 415 return jsonify({"error": "No JSON payload"}), 415
port: str = data.get('port') port: str = data.get('port')
command: str = data.get('command') _command: str = data.get('command')
print(f'Server {port} executed command {command}') print(f'Server {port} executed command {_command}')
generic_executor.RunCommand(port, command) generic_executor.RunCommand(port, _command)
return jsonify({'message': 'OK'}), 200 return jsonify({'message': 'OK'}), 200

4
requirements.txt Normal file
View File

@ -0,0 +1,4 @@
Flask==3.0.3
Flask_Cors==4.0.1
plotly==5.22.0
psutil==5.9.8