This commit is contained in:
Your Name
2025-04-30 21:39:07 +12:00
parent fe9c940a22
commit aa234ebef5
2 changed files with 9 additions and 8 deletions

View File

@@ -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()) {

View File

@@ -107,7 +107,7 @@ void Server::handle_connection(int client_socket) {
return;
}
if (path == "/index.html") {
if (path == "/index.html" || path == "/") {
send_response(client_socket, 200, "text/html",
"<html><body><h1>Dropshell Template Registry</h1></body></html>");
return;