Server API rework.

This commit is contained in:
Chunting Gu
2019-06-26 17:34:39 +08:00
parent a65294aeec
commit a3cab444dc
20 changed files with 341 additions and 384 deletions
+1 -6
View File
@@ -11,8 +11,7 @@ using tcp = boost::asio::ip::tcp;
namespace webcc {
Server::Server(std::uint16_t port, std::size_t workers,
const std::string& doc_root)
Server::Server(std::uint16_t port, std::size_t workers, const Path& doc_root)
: acceptor_(io_context_), signals_(io_context_), workers_(workers),
request_handler_(doc_root) {
RegisterSignals();
@@ -52,10 +51,6 @@ Server::Server(std::uint16_t port, std::size_t workers,
}
}
bool Server::Bind(ServicePtr service, const std::string& url, bool is_regex) {
return request_handler_.Bind(service, url, is_regex);
}
void Server::Run() {
if (!acceptor_.is_open()) {
LOG_ERRO("Server is NOT going to run.");