From e40605da59e368be524dee0e9e9d41ef05149473 Mon Sep 17 00:00:00 2001 From: yorickdewid Date: Mon, 3 Oct 2016 15:32:16 +0200 Subject: HTTP response redirect - Log address --- include/crow/http_response.h | 6 ++++++ include/crow/http_server.h | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) 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*/){ -- cgit v1.2.3-54-g00ecf