memgraph/speedy/speedy.hpp

37 lines
778 B
C++
Raw Normal View History

#ifndef MEMGRAPH_SPEEDY_HPP
#define MEMGRAPH_SPEEDY_HPP
#include <vector>
2015-09-20 20:30:26 +08:00
#include "io/uv/uv.hpp"
#include "http/http.hpp"
#include "r3_include.h"
namespace speedy
{
typedef unsigned int uint;
class Speedy
{
private:
http::HttpServer server;
http::Ipv4 ip;
node *n;
std::vector<http::request_cb_t> callbacks;
void store_index(int method, const std::string &path);
public:
2015-09-20 20:30:26 +08:00
Speedy(uv::UvLoop& loop, const http::Ipv4& ip);
void get(const std::string &path, http::request_cb_t callback);
void post(const std::string &path, http::request_cb_t callback);
void put(const std::string &path, http::request_cb_t callback);
void del(const std::string &path, http::request_cb_t callback);
void listen();
};
}
#include "speedy.inl"
#endif