added telnet and reboot control, openrouterinit script

This commit is contained in:
wt committed 2024-06-26 15:59:10 +07:00
1 parent 0937112f04
commit 5279a9a6a6
23 files changed
+839 -26

No files matched your search

+8 -2
View File
@@ -1,6 +1,8 @@
#include <iostream>
#include <httplib.h>
#include <colors.h>
#include "settings/telnet/telnet.hpp"
#include "reboot/reboot.hpp"
#define CORS_ENABLE
#include "security/cors.hpp"
@@ -8,6 +10,10 @@
int main() {
httplib::Server srv;
srv.Post("/api/settings/telnet/get", get_telnet);
srv.Post("/api/settings/telnet/set", set_telnet);
srv.Post("/api/reboot", reboot);
srv.Options("/(.*)", set_cors_headers);
srv.set_mount_point("/" , "../src/web");
@@ -15,8 +21,8 @@ int main() {
srv.set_mount_point("/css", "../src/web/css");
std::cout << GREEN << "Starting" << RESET << " server on [ " << YELLOW
<< "localhost" << RESET << ":" << CYAN << "43243" << RESET << " ]" << std::endl;
<< "0.0.0.0" << RESET << ":" << CYAN << "43244" << RESET << " ]" << std::endl;
srv.listen("localhost", 43244);
srv.listen("0.0.0.0", 43244);
return 0;
}