mirror of
https://gitee.com/acl-dev/acl.git
synced 2024-12-14 08:50:53 +08:00
28 lines
485 B
C++
28 lines
485 B
C++
#pragma once
|
|
|
|
#include <string>
|
|
#include "detail/http_server_impl.hpp"
|
|
|
|
namespace acl {
|
|
|
|
class http_server : public http_server_impl {
|
|
public:
|
|
http_server(const char* addr) : http_server_impl(addr) {}
|
|
~http_server(void) {}
|
|
|
|
void run(int nthreads) {
|
|
http_server_impl::run(nthreads);
|
|
}
|
|
|
|
public:
|
|
void get(const std::string path, handler_t fn) {
|
|
this->service(path, fn);
|
|
}
|
|
|
|
void post(const std::string& path, handler_t fn) {
|
|
this->service(path, fn);
|
|
}
|
|
};
|
|
|
|
} // namespace acl
|