aboutsummaryrefslogtreecommitdiff
path: root/main.cpp
diff options
context:
space:
mode:
authorneodarz <neodarz@neodarz.net>2019-09-09 17:56:09 +0200
committerneodarz <neodarz@neodarz.net>2019-09-09 17:56:09 +0200
commit260ce7465a66427832da15caae0077323dc9750a (patch)
tree0c12d17cd53c719a160277b10aa89dc12e845a31 /main.cpp
parentbc6aeaa834d666221171d302d4f101ce65608898 (diff)
downloadumosapicpp-260ce7465a66427832da15caae0077323dc9750a.tar.xz
umosapicpp-260ce7465a66427832da15caae0077323dc9750a.zip
Refactoring a little more
Diffstat (limited to 'main.cpp')
-rw-r--r--main.cpp30
1 files changed, 10 insertions, 20 deletions
diff --git a/main.cpp b/main.cpp
index dd3b794..2ca3399 100644
--- a/main.cpp
+++ b/main.cpp
@@ -8,13 +8,12 @@
#include "config.h"
#include "api/umosapi.h"
-#include "service.hpp"
std::map<std::string, std::string> config;
int main(int argc, char *argv[]) {
- string config_path = "";
+ std::string config_path = "";
const char *homedir;
if ((homedir = getenv("XDG_CONFIG_HOME")) == NULL || (homedir = getenv("HOME")) == NULL) {
@@ -44,32 +43,23 @@ int main(int argc, char *argv[]) {
exit(1);
}
- //Address addr(Ipv4::any(), Port(config["port"]));
+ std::cout << "INFO: Using " << std::thread::hardware_concurrency() << " cores";
+ std::cout << " - " << thr << " threads" << std::endl;
+ std::cout << "INFO: Listen on 0.0.0.0:" << config["port"] << std::endl;
- cout << "INFO: Using " << std::thread::hardware_concurrency() << " cores";
- cout << " - " << thr << " threads" << endl;
- cout << "INFO: Listen on 0.0.0.0:" << config["port"] << endl;
-
- cout << "INFO: Using config file '" << config_path << "'" << endl;
+ std::cout << "INFO: Using config file '" << config_path << "'" << std::endl;
if (!std::filesystem::exists(config_path)) {
- cout << "ERROR: Error fatal : config file '" << config_path << "' not found" << endl;
- cout << "ERROR: config.txt is search here: ~/.config/umosapi/config.txt" << endl;
+ std::cout << "ERROR: Error fatal : config file '" << config_path << "' not found" << std::endl;
+ std::cout << "ERROR: config.txt is search here: ~/.config/umosapi/config.txt" << std::endl;
exit (EXIT_FAILURE);
}
load_config(config_path);
- //cout << "Using swaggerui " << config["swaggerui"] << " path" << endl;
- cout << "INFO: No support for swagger for the moment" << endl;
- cout << "INFO: Using mongoURI " << config["mongoURI"] << endl;
- /*
-
- UmosapiService umosapi(addr);
-
- umosapi.init(thr);
- umosapi.start(config["swaggerui"]);
- */
+ std::cout << "Using swaggerui " << config["swaggerui"] << " path" << std::endl;
+ std::cout << "INFO: No support for swagger for the moment" << std::endl;
+ std::cout << "INFO: Using mongoURI " << config["mongoURI"] << std::endl;
UmosapiService::Api umosapi;
umosapi.init();