aboutsummaryrefslogtreecommitdiffstats
path: root/flask.h
diff options
context:
space:
mode:
authoripknHama <ipknhama@gmail.com>2014-04-01 01:51:50 +0900
committeripknHama <ipknhama@gmail.com>2014-04-01 01:51:50 +0900
commit4b8c67e2300205200f4f846400d73a03cb3da854 (patch)
tree46b63650efd6952cf88a62cc0511162af54d896f /flask.h
parent1e11a177ee6b680b55f01d6090ccd1b2e2b8c51c (diff)
downloadcrow-4b8c67e2300205200f4f846400d73a03cb3da854.tar.gz
crow-4b8c67e2300205200f4f846400d73a03cb3da854.zip
accept connections, print http request parsed information
Diffstat (limited to 'flask.h')
-rw-r--r--flask.h31
1 files changed, 31 insertions, 0 deletions
diff --git a/flask.h b/flask.h
index ff134f7..c694de1 100644
--- a/flask.h
+++ b/flask.h
@@ -1,3 +1,15 @@
+#pragma once
+#include <string>
+#include <functional>
+#include <memory>
+#include <future>
+#include <stdint.h>
+
+#include "http_server.h"
+
+// TEST
+#include <iostream>
+
namespace flask
{
class Flask
@@ -7,8 +19,27 @@ namespace flask
{
}
+ void handle()
+ {
+ }
+
+ void route(const std::string& url, std::function<std::string()> f)
+ {
+ }
+
+ Flask& port(std::uint16_t port)
+ {
+ port_ = port;
+ return *this;
+ }
+
void run()
{
+ Server<Flask> server(this, port_);
+ server.run();
}
+ private:
+ uint16_t port_ = 80;
};
};
+