From 7f78006f8fd439b31748efbb538f01fc6a4c1636 Mon Sep 17 00:00:00 2001 From: Hepatica Date: Wed, 14 Aug 2024 00:17:19 +0200 Subject: [PATCH] Adjust dotnet publish and change port of app --- .$SpCloud.drawio.bkp | 85 +++++++++ SpCloud.drawio | 172 ++++++++++++++++++ SpCloudMain/Controllers/PublishController.cpp | 7 +- SpCloudMain/SpCloudMain.cpp | 6 +- 4 files changed, 267 insertions(+), 3 deletions(-) create mode 100644 .$SpCloud.drawio.bkp create mode 100644 SpCloud.drawio diff --git a/.$SpCloud.drawio.bkp b/.$SpCloud.drawio.bkp new file mode 100644 index 0000000..20cb23f --- /dev/null +++ b/.$SpCloud.drawio.bkp @@ -0,0 +1,85 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SpCloud.drawio b/SpCloud.drawio new file mode 100644 index 0000000..a9dd047 --- /dev/null +++ b/SpCloud.drawio @@ -0,0 +1,172 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SpCloudMain/Controllers/PublishController.cpp b/SpCloudMain/Controllers/PublishController.cpp index 3f73056..9f223e0 100644 --- a/SpCloudMain/Controllers/PublishController.cpp +++ b/SpCloudMain/Controllers/PublishController.cpp @@ -69,7 +69,12 @@ public: private: void dotnet_publish(const std::string& path) { - std::string dll_file_name = file_processing->find_file_by_suffix(path, "dll"); + std::string dll_file_name = file_processing->find_file_by_suffix(path, "exe"); + + size_t pos = dll_file_name.find(".exe"); + if (pos != std::string::npos) { + dll_file_name.replace(pos, 4, ".dll"); + } std::string command = R"(dotnet )" + path + "/" + dll_file_name; diff --git a/SpCloudMain/SpCloudMain.cpp b/SpCloudMain/SpCloudMain.cpp index 4632a2a..5fe8f1d 100644 --- a/SpCloudMain/SpCloudMain.cpp +++ b/SpCloudMain/SpCloudMain.cpp @@ -39,14 +39,16 @@ int main() PublishController publish_controller(svr, authorization_service, file_processing, logger); - std::cout << "Server is running at http://localhost:8080" << '\n'; + std::cout << "Server is running at http://localhost:8081" << '\n'; svr.Post("/publish", [&](const httplib::Request& req, httplib::Response& res) { logger.log(INFO, "Start publish from main"); publish_controller.process_publish(req, res); + + res.set_content("App is running on address ????", "text/plain");//Todo add app address showing }); - svr.listen("0.0.0.0", 8080); + svr.listen("0.0.0.0", 8081); }