memgraph/memgraph.cpp

36 lines
681 B
C++
Raw Normal View History

2015-10-09 07:24:12 +08:00
#include <iostream>
#include <vector>
#include "debug/log.hpp"
#include "utils/ioc/container.hpp"
#include "database/db.hpp"
2015-10-09 07:24:12 +08:00
#include "speedy/speedy.hpp"
#include "api/resources/include.hpp"
#include "threading/pool.hpp"
#include "threading/task.hpp"
2015-10-09 07:24:12 +08:00
int main()
2015-10-09 07:24:12 +08:00
{
ioc::Container container;
container.singleton<Db>();
auto loop = container.singleton<uv::UvLoop>();
auto app = container.singleton<sp::Speedy, uv::UvLoop>("/db/data");
container.singleton<Pool>(4);
container.singleton<Task, uv::UvLoop, Pool>();
2015-10-09 07:24:12 +08:00
init(container);
2015-10-09 07:24:12 +08:00
http::Ipv4 ip("0.0.0.0", 7474);
app->listen(ip);
2015-10-09 07:24:12 +08:00
loop->run(uv::UvLoop::Mode::Default);
2015-10-09 07:24:12 +08:00
return 0;
}