mirror of
https://github.com/hubHarmony/servii-backend.git
synced 2024-11-17 21:40:31 +00:00
[+] Requirements.txt
This commit is contained in:
parent
cb674ac22a
commit
ac330232ed
10
api.py
10
api.py
@ -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
4
requirements.txt
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
Flask==3.0.3
|
||||||
|
Flask_Cors==4.0.1
|
||||||
|
plotly==5.22.0
|
||||||
|
psutil==5.9.8
|
Loading…
Reference in New Issue
Block a user