#ifndef __APPLICATION_H__ #define __APPLICATION_H__ #include "Router/matches.hpp" #include namespace Core { class IoContext; } // namespace Core namespace boost { namespace asio { class io_context; } } // namespace boost namespace Danki { class ApplicationPrivate; class Settings; class HttpSession; class SignalServer; class Application : public std::enable_shared_from_this { public: using Request = boost::beast::http::request; using RequestHandler = std::function; Application(); boost::asio::io_context &ioContext(); void insertUrl(std::string_view url, RequestHandler &&handler); int exec(); void startAcceptHttpConnections(const std::string &address, uint16_t port); protected: void asyncAcceptHttpConnections(); private: ApplicationPrivate *m_d = nullptr; std::shared_ptr m_settings; std::shared_ptr m_ioContext; std::shared_ptr m_signalServer; }; } // namespace Danki #endif // __APPLICATION_H__