diff --git a/src/App.h b/src/App.h index dd7b40c..35a397c 100644 --- a/src/App.h +++ b/src/App.h @@ -268,6 +268,13 @@ public: return std::move(*this); } + /* Host, port, callback */ + TemplatedApp &&listen(std::string host, int port, fu2::unique_function &&handler) { + handler(httpContext->listen(host.c_str(), port, 0)); + return std::move(*this); + } + + /* Port, callback */ TemplatedApp &&listen(int port, fu2::unique_function &&handler) { handler(httpContext->listen(nullptr, port, 0)); return std::move(*this);