-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapi.py
More file actions
32 lines (27 loc) · 685 Bytes
/
api.py
File metadata and controls
32 lines (27 loc) · 685 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# api.py
from flask import Flask
from routes import (
list_dir,
remove_file,
upload_file,
download_file,
running_processes,
execute_command,
system_uptime,
reboot_device,
kill_process,
shutdown_device,
)
app = Flask(__name__)
list_dir.register_routes(app)
remove_file.register_routes(app)
upload_file.register_routes(app)
download_file.register_routes(app)
running_processes.register_routes(app)
execute_command.register_routes(app)
system_uptime.register_routes(app)
reboot_device.register_routes(app)
kill_process.register_routes(app)
shutdown_device.register_routes(app)
if __name__ == "__main__":
app.run(host="0.0.0.0", port=8080)