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

refactor(http): replace service/method with simple HTTP path #594

Merged
merged 15 commits into from
Aug 31, 2020

Conversation

neverchanje
Copy link
Contributor

@neverchanje neverchanje commented Aug 15, 2020

This PR I replace http_request::service_method with a simple URL path.

struct http_request
{
    static error_with<http_request> parse(dsn::message_ex *m);

-    // http://ip:port/<service>/<method>
-    std::pair<std::string, std::string> service_method;
+    std::string path;

And I decouple the registration of HTTP calls from http_server to http_call_registry.

  • http_server is a special RPC server that handles HTTP requests.
  • http_call_registry manages the HTTP calls.

I will in later PR provide a simpler HTTP service API based on http_call_registry

@neverchanje neverchanje added the component/http HTTP/RESTful support label Aug 15, 2020
acelyc111
acelyc111 previously approved these changes Aug 20, 2020
levy5307
levy5307 previously approved these changes Aug 20, 2020
@neverchanje neverchanje dismissed stale reviews from levy5307 and acelyc111 via a6d68e7 August 20, 2020 15:46
@acelyc111
Copy link
Member

@neverchanje CI is failed

@neverchanje neverchanje merged commit 9dee4d2 into XiaoMi:master Aug 31, 2020
@neverchanje neverchanje deleted the http-refactoring-server branch August 31, 2020 03:59
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants