diff --git a/src/App.h b/src/App.h index 0081b33..85b80fc 100644 --- a/src/App.h +++ b/src/App.h @@ -284,12 +284,24 @@ public: return std::move(*this); } + /* Host, port, options, callback */ + TemplatedApp &&listen(std::string host, int port, int options, fu2::unique_function &&handler) { + handler(httpContext->listen(host.c_str(), port, options)); + return std::move(*this); + } + /* Port, callback */ TemplatedApp &&listen(int port, fu2::unique_function &&handler) { handler(httpContext->listen(nullptr, port, 0)); return std::move(*this); } + /* Port, options, callback */ + TemplatedApp &&listen(int port, int options, fu2::unique_function &&handler) { + handler(httpContext->listen(nullptr, port, options)); + return std::move(*this); + } + TemplatedApp &&run() { uWS::run(); return std::move(*this);