aboutsummaryrefslogtreecommitdiffstats
path: root/flask.h
diff options
context:
space:
mode:
Diffstat (limited to 'flask.h')
-rw-r--r--flask.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/flask.h b/flask.h
index 6d222e0..ec14f9a 100644
--- a/flask.h
+++ b/flask.h
@@ -7,11 +7,14 @@
#include <type_traits>
#include "http_server.h"
+#include "utility.h"
#include "routing.h"
// TEST
#include <iostream>
+#define FLASK_ROUTE(app, url) app.route<flask::black_magic::get_parameter_tag(url)>(url)
+
namespace flask
{
class Flask
@@ -26,6 +29,13 @@ namespace flask
return router_.handle(req);
}
+ template <uint64_t Tag>
+ auto route(std::string&& rule)
+ -> typename std::result_of<decltype(&Router::new_rule_tagged<Tag>)(Router, std::string&&)>::type
+ {
+ return router_.new_rule_tagged<Tag>(std::move(rule));
+ }
+
auto route(std::string&& rule)
-> typename std::result_of<decltype(&Router::new_rule)(Router, std::string&&)>::type
{