Skip to content

Commit

Permalink
Merge pull request #2 from marelab:FixTypo-&-VFS-reference
Browse files Browse the repository at this point in the history
Fix Typo & VFS ref.
  • Loading branch information
marelab authored Feb 26, 2024
2 parents 0c5f68c + 5b626a7 commit 6361b6d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/mesh/raspihttp/PiWebServer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -486,12 +486,13 @@ PiWebServerThread::PiWebServerThread()

configWeb.files_path = (char *)webrootpath.c_str();
configWeb.url_prefix = "";
configWeb.rootPath = strdup(portduinoVFS->mountpoint());

u_map_put(instanceWeb.default_headers, "Access-Control-Allow-Origin", "*");
// Maximum body size sent by the client is 1 Kb
instanceWeb.max_post_body_size = 1024;
ulfius_add_endpoint_by_val(&instanceWeb, "GET", PREFIX, "/api/v1/fromradio/*", 1, &handleAPIv1FromRadio, NULL);
ulfius_add_endpoint_by_val(&instanceWeb, "PUT", PREFIX, "/api/v1/toradio/*", 1, &handleAPIv1ToRadio, NULL);
ulfius_add_endpoint_by_val(&instanceWeb, "PUT", PREFIX, "/api/v1/toradio/*", 1, &handleAPIv1ToRadio, configWeb.rootPath);

// Add callback function to all endpoints for the Web Server
ulfius_add_endpoint_by_val(&instanceWeb, "GET", NULL, "/*", 2, &callback_static_file, &configWeb);
Expand All @@ -503,7 +504,7 @@ PiWebServerThread::PiWebServerThread()
retssl = ulfius_start_secure_framework(&instanceWeb, key_pem, cert_pem);

if (retssl == U_OK) {
LOG_INFO("Web Server framework srated on port: %i \n", webservport);
LOG_INFO("Web Server framework started on port: %i \n", webservport);
LOG_INFO("Web Server root %s\n", (char *)webrootpath.c_str());
} else {
LOG_ERROR("Error starting Web Server framework\n");
Expand Down
1 change: 1 addition & 0 deletions src/mesh/raspihttp/PiWebServer.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ struct _file_config {
struct _u_map mime_types;
struct _u_map map_header;
char *redirect_on_404;
char *rootPath;
};

class PiWebServerThread
Expand Down

0 comments on commit 6361b6d

Please sign in to comment.