{"id":15010148,"url":"https://github.com/undr/jsonrpc2_plug","last_synced_at":"2026-03-10T17:38:24.481Z","repository":{"id":37788244,"uuid":"448122969","full_name":"undr/jsonrpc2_plug","owner":"undr","description":"An Elixir `plug` library for extending an HTTP server with JSONRPC 2.0 protocol services. It's HTTP transport level. For use both in the Phoenix application and pure `plug`-compatable server.","archived":false,"fork":false,"pushed_at":"2025-12-16T09:38:29.000Z","size":40,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-12-19T22:45:37.877Z","etag":null,"topics":["elixir","jsonrpc2","phoenix","phoenix-framework","plug"],"latest_commit_sha":null,"homepage":"","language":"Elixir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/undr.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-01-14T22:22:22.000Z","updated_at":"2025-12-16T09:38:33.000Z","dependencies_parsed_at":"2024-09-24T19:31:08.867Z","dependency_job_id":"dee34b3d-25d6-49df-8c66-2155001abda7","html_url":"https://github.com/undr/jsonrpc2_plug","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/undr/jsonrpc2_plug","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/undr%2Fjsonrpc2_plug","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/undr%2Fjsonrpc2_plug/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/undr%2Fjsonrpc2_plug/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/undr%2Fjsonrpc2_plug/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/undr","download_url":"https://codeload.github.com/undr/jsonrpc2_plug/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/undr%2Fjsonrpc2_plug/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30344828,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-10T15:55:29.454Z","status":"ssl_error","status_checked_at":"2026-03-10T15:54:58.440Z","response_time":106,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["elixir","jsonrpc2","phoenix","phoenix-framework","plug"],"created_at":"2024-09-24T19:30:50.857Z","updated_at":"2026-03-10T17:38:24.471Z","avatar_url":"https://github.com/undr.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"# JSONRPC2.Plug\n\nAn Elixir `plug` library for extending an HTTP server with JSONRPC 2.0 protocol services. It's HTTP transport level. For use both in the Phoenix application and pure `plug`-compatable server.\n\n## Installation\n\nThe package can be installed by adding `jsonrpc2_plug` to your list of dependencies in `mix.exs`:\n\n```elixir\ndef deps do\n  [\n    {:jsonrpc2_plug, \"~\u003e 2.0.0\"}\n  ]\nend\n```\n\n## Usage\n\n### Services\n\nIt uses [`jsonrpc2_service`](https://github.com/undr/jsonrpc2_service) library for service creation.\n\n### Pure `plug`-compatable server\n\n```elixir\nuse Plug.Router\n\nforward \"/jsonrpc\", to: JSONRPC2.Plug, init_opts: CalculatorService\n```\n\n`CalculatorService` is a service build by [`jsonrpc2_service`](https://github.com/undr/jsonrpc2_service) library\n\nYou can handle errors outside of `plug`. Add `Plug.ErrorHandler` into a router and define `\u0026handle_errors/2` function ([read more](https://hexdocs.pm/plug/Plug.ErrorHandler.html)). \n\n```elixir\n  use Plug.ErrorHandler\n\n  @impl Plug.ErrorHandler\n  def handle_errors(conn, %{kind: kind, reason: reason, stack: stacktrace}) do\n    kind |\u003e Exception.format(reason, stacktrace) |\u003e Logger.error()\n\n    case conn do\n      %{request_path: \"/jsonrpc\"} -\u003e\n        JSONRPC2.Plug.send_error(conn, kind, reason)\n\n      _ -\u003e\n        send_resp(conn, 500, \"Someting went wrong\")\n    end\n  end\n```\n\n### Phoenix server\n\n```elixir\n\nforward \"/jsonrpc\", JSONRPC2.Plug, CalculatorService\n```\n\nDocumentation can be generated with [ExDoc](https://github.com/elixir-lang/ex_doc)\nand published on [HexDocs](https://hexdocs.pm). Once published, the docs can\nbe found at [https://hexdocs.pm/jsonrpc2_plug](https://hexdocs.pm/jsonrpc2_plug).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fundr%2Fjsonrpc2_plug","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fundr%2Fjsonrpc2_plug","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fundr%2Fjsonrpc2_plug/lists"}