-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathmain.cpp
More file actions
74 lines (63 loc) · 4.02 KB
/
main.cpp
File metadata and controls
74 lines (63 loc) · 4.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#include <userver/clients/dns/component.hpp>
#include <userver/clients/http/component_list.hpp>
#include <userver/components/minimal_server_component_list.hpp>
#include <userver/server/handlers/ping.hpp>
#include <userver/server/handlers/tests_control.hpp>
#include <userver/storages/postgres/component.hpp>
#include <userver/testsuite/testsuite_support.hpp>
#include <userver/utils/daemon_run.hpp>
#include "handlers/auth/auth_bearer.hpp"
#include "handlers/profiles/profiles.hpp"
#include "handlers/profiles/profiles_follow.hpp"
#include "handlers/profiles/profiles_follow_delete.hpp"
#include "handlers/tags/tags.hpp"
#include "handlers/comments/comment_delete.hpp"
#include "handlers/comments/comment_post.hpp"
#include "handlers/comments/comments_get.hpp"
#include "handlers/users/user_get.hpp"
#include "handlers/users/user_put.hpp"
#include "handlers/users/users.hpp"
#include "handlers/users/users_login.hpp"
#include "cache/articles_cache.hpp"
#include "cache/comments_cache.hpp"
#include "handlers/articles/articles_favorite.hpp"
#include "handlers/articles/articles_get.hpp"
#include "handlers/articles/articles_post.hpp"
#include "handlers/articles/articles_slug_delete.hpp"
#include "handlers/articles/articles_slug_get.hpp"
#include "handlers/articles/articles_slug_put.hpp"
#include "handlers/articles/articles_unfavorite.hpp"
#include "handlers/articles/feed_articles.hpp"
using namespace real_medium::handlers;
int main(int argc, char* argv[]) {
userver::server::handlers::auth::RegisterAuthCheckerFactory<real_medium::auth::CheckerFactory>();
auto component_list = userver::components::MinimalServerComponentList()
.Append<userver::server::handlers::Ping>()
.Append<userver::components::TestsuiteSupport>()
.Append<real_medium::cache::articles_cache::ArticlesCache>()
.Append<real_medium::cache::comments_cache::CommentsCache>()
.AppendComponentList(userver::clients::http::ComponentList())
.Append<userver::components::Postgres>("realmedium-database")
.Append<userver::clients::dns::Component>() // real_medium::handlers::users_login::post
.Append<userver::server::handlers::TestsControl>()
.Append<real_medium::handlers::users::put::Handler>()
.Append<real_medium::handlers::users::get::Handler>()
.Append<real_medium::handlers::comments::del::Handler>()
.Append<real_medium::handlers::comments::post::Handler>()
.Append<real_medium::handlers::comments::get::Handler>()
.Append<real_medium::handlers::users::post::RegisterUser>()
.Append<real_medium::handlers::profiles::get::Handler>()
.Append<real_medium::handlers::profiles::post::Handler>()
.Append<real_medium::handlers::profiles::del::Handler>()
.Append<real_medium::handlers::tags::get::Handler>()
.Append<real_medium::handlers::articles::feed::get::Handler>()
.Append<real_medium::handlers::articles::get::Handler>()
.Append<real_medium::handlers::articles::post::Handler>()
.Append<real_medium::handlers::articles_slug::get::Handler>()
.Append<real_medium::handlers::articles_slug::put::Handler>()
.Append<real_medium::handlers::articles_slug::del::Handler>()
.Append<real_medium::handlers::articles_favorite::post::Handler>()
.Append<real_medium::handlers::articles_favorite::del::Handler>();
real_medium::handlers::users_login::post::AppendLoginUser(component_list);
return userver::utils::DaemonMain(argc, argv, component_list);
}