diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/crow/http_response.h | 6 | ||||
-rw-r--r-- | include/crow/http_server.h | 2 |
2 files changed, 7 insertions, 1 deletions
diff --git a/include/crow/http_response.h b/include/crow/http_response.h index f5e03b4..7940174 100644 --- a/include/crow/http_response.h +++ b/include/crow/http_response.h @@ -86,6 +86,12 @@ namespace crow completed_ = false; } + void redirect(const std::string& location) + { + code = 301; + set_header("Location", location); + } + void write(const std::string& body_part) { body += body_part; diff --git a/include/crow/http_server.h b/include/crow/http_server.h index d5abb11..ab2631b 100644 --- a/include/crow/http_server.h +++ b/include/crow/http_server.h @@ -141,7 +141,7 @@ namespace crow }); } - CROW_LOG_INFO << server_name_ << " server is running, local port " << port_; + CROW_LOG_INFO << server_name_ << " server is running at " << bindaddr_ <<":" << port_; signals_.async_wait( [&](const boost::system::error_code& /*error*/, int /*signal_number*/){ |