Skip to content
This repository has been archived by the owner on Jun 23, 2022. It is now read-only.

feat(http): print help info on root path of the http server #367

Merged
merged 4 commits into from
Dec 26, 2019

Conversation

neverchanje
Copy link
Contributor

@neverchanje neverchanje commented Dec 22, 2019

Example

http 127.0.0.1:34601

{
    "/": "ip:port/", 
    "/meta/app": "ip:port/meta/app?app_name=temp", 
    "/meta/app_envs": "ip:port/meta/app_envs?name=temp", 
    "/meta/apps": "ip:port/meta/apps", 
    "/meta/backup_policy": "ip:port/meta/backup_policy", 
    "/meta/cluster": "ip:port/meta/cluster", 
    "/meta/nodes": "ip:port/meta/nodes", 
    "/perfCounter": "ip:port/perfCounter?name={perf_counter_name}", 
    "/pprof/cmdline": "ip:port/pprof/cmdline", 
    "/pprof/growth": "ip:port/pprof/growth", 
    "/pprof/heap": "ip:port/pprof/heap", 
    "/pprof/profile": "ip:port/pprof/profile", 
    "/pprof/symbol": "ip:port/pprof/symbol", 
    "/recentStartTime": "ip:port/recentStartTime", 
    "/version": "ip:port/version"
}
http 127.0.0.1:34801
{
    "/": "ip:port/", 
    "/perfCounter": "ip:port/perfCounter?name={perf_counter_name}", 
    "/pprof/cmdline": "ip:port/pprof/cmdline", 
    "/pprof/growth": "ip:port/pprof/growth", 
    "/pprof/heap": "ip:port/pprof/heap", 
    "/pprof/profile": "ip:port/pprof/profile", 
    "/pprof/symbol": "ip:port/pprof/symbol", 
    "/recentStartTime": "ip:port/recentStartTime", 
    "/version": "ip:port/version"
}

@neverchanje neverchanje added the component/http HTTP/RESTful support label Dec 22, 2019
register_handler("",
std::bind(&perf_counter_http_service::get_perf_counter_handler,
this,
std::placeholders::_1,
std::placeholders::_2));
std::placeholders::_2),
"ip:port/perfCounter?name={perf_counter_name}");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里能把实际的IP port填进去吗?

Copy link
Contributor Author

@neverchanje neverchanje Dec 26, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

填实际 ip port 需要启动整个 dsn runtime,加一大堆配置,所以偷懒就没做了,我希望等之后 rpc 模块和 dsn runtime 解藕之后做

};

class http_server : public serverlet<http_server>
{
public:
http_server();
explicit http_server(bool start = true);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

start 仅用来做测试的标志?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

目前是的,不知道以后会不会有别的需求

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
1.12.2 component/http HTTP/RESTful support
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants