diff options
Diffstat (limited to 'plugins/static-files/static-files.cpp')
-rw-r--r-- | plugins/static-files/static-files.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/plugins/static-files/static-files.cpp b/plugins/static-files/static-files.cpp index 287c975..358e239 100644 --- a/plugins/static-files/static-files.cpp +++ b/plugins/static-files/static-files.cpp @@ -19,8 +19,16 @@ static_files_plugin::~static_files_plugin() //std::cout << "Plugin destructor" << std::endl; } -std::string static_files_plugin::generate_page(std::string path) +std::string static_files_plugin::generate_page( + std::function<std::string(const std::string& key)>& GetServerParam, + std::function<std::string(const std::string& key)>& GetRequestParam, // request including body (POST...) + std::function<void(const std::string& key, const std::string& value)>& SetResponseHeader // to be added to result string +) { - return "Static Files "s + path; + try { + return "Static Files "s + GetServerParam("path"s); + } catch (const std::exception& ex) { + return "Error: "s + ex.what(); + } } |