Adjust dotnet publish and change port of app

This commit is contained in:
Hepatica
2024-08-14 00:17:19 +02:00
parent cdb87e09a1
commit 7f78006f8f
4 changed files with 267 additions and 3 deletions

View File

@@ -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;

View File

@@ -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);
}