blob: 358e2397f68ceafafca2d93e3b4fefc20ff8c98c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
#include "static-files.h"
#include <iostream>
using namespace std::string_literals;
std::string static_files_plugin::name()
{
return "static-files";
}
static_files_plugin::static_files_plugin()
{
//std::cout << "Plugin constructor" << std::endl;
}
static_files_plugin::~static_files_plugin()
{
//std::cout << "Plugin destructor" << std::endl;
}
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
)
{
try {
return "Static Files "s + GetServerParam("path"s);
} catch (const std::exception& ex) {
return "Error: "s + ex.what();
}
}
|