summaryrefslogtreecommitdiff
path: root/http_static.h
diff options
context:
space:
mode:
Diffstat (limited to 'http_static.h')
-rw-r--r--http_static.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/http_static.h b/http_static.h
new file mode 100644
index 0000000..f8d2bec
--- /dev/null
+++ b/http_static.h
@@ -0,0 +1,26 @@
+#ifndef HTTP_STATIC_H
+#define HTTP_STATIC_H
+
+#include "http_connection.h"
+
+#include <boost/filesystem.hpp>
+
+namespace fs = boost::filesystem;
+
+namespace HTTP {
+ //! HTTP Handler serving static files from a directory.
+ class Static {
+ private:
+ fs::path directory_;
+ std::string index_;
+
+ public:
+ //! Construct Static-handler.
+ Static(fs::path directory, std::string index = "index.html");
+
+ //! Handle request.
+ void operator()(Connection::p connection);
+ };
+};
+
+#endif