.
This commit is contained in:
15
src/main.cpp
15
src/main.cpp
@@ -4,16 +4,17 @@
|
||||
#include <string>
|
||||
|
||||
int main(int argc, char* argv[]) {
|
||||
if (argc != 2) {
|
||||
std::cerr << "Usage: " << argv[0] << " <config_file>" << std::endl;
|
||||
std::filesystem::path config_path = std::filesystem::path(std::getenv("HOME")) / ".config/dropshell_template_registry/config.json";
|
||||
std::filesystem::create_directories(config_path.parent_path());
|
||||
|
||||
dropshell::ServerConfig config;
|
||||
if (!dropshell::load_config(config_path, config)) {
|
||||
std::cerr << "Failed to load configuration at "<<config_path << std::endl;
|
||||
return 1;
|
||||
}
|
||||
|
||||
dropshell::ServerConfig config;
|
||||
if (!dropshell::load_config(argv[1], config)) {
|
||||
std::cerr << "Failed to load configuration" << std::endl;
|
||||
return 1;
|
||||
}
|
||||
std::cout << "Starting server at " << config.host << ":" << config.port << std::endl;
|
||||
std::cout << "Object store path: " << config.object_store_path << std::endl;
|
||||
|
||||
dropshell::Server server(config);
|
||||
if (!server.start()) {
|
||||
|
Reference in New Issue
Block a user