Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/shirokovnv/phx_json_rpc
Simple JSON RPC server written in elixir.
https://github.com/shirokovnv/phx_json_rpc
elixir json phoenix rpc
Last synced: 1 day ago
JSON representation
Simple JSON RPC server written in elixir.
- Host: GitHub
- URL: https://github.com/shirokovnv/phx_json_rpc
- Owner: shirokovnv
- License: mit
- Created: 2022-07-03T07:27:33.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2024-10-21T06:33:12.000Z (29 days ago)
- Last Synced: 2024-10-25T02:32:38.939Z (25 days ago)
- Topics: elixir, json, phoenix, rpc
- Language: Elixir
- Homepage:
- Size: 257 KB
- Stars: 5
- Watchers: 1
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.md
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# PhxJsonRpc
![ci.yml][link-ci]
[![hex.pm badge][link-shield]][link-hex]Simple implementation of JSON-RPC server, written in [elixir][link-elixir] and working with [phoenix][link-phoenix].
Allows you to define any number of rpc endpoints, which can be accessed via http protocol.
## How it works
The package uses router `macro` for matching RPC calls to your end-user service.
It uses `JSON SCHEMA` as a specification for your services and provides parsing, validation and error handling briefly.
Requests can be served in batches with asyncronous order.
For usage with phoenix see this [guide][link-guide].
## Installation
The package can be installed
by adding `phx_json_rpc` to your list of dependencies in `mix.exs`:```elixir
def deps do
[
{:phx_json_rpc, "~> 0.7.0"}
]
end
```This package depends on [ex_json_schema](https://github.com/jonasschmidt/ex_json_schema) for validation purposes.
## Supported phoenix versions
The package tested with `phoenix >= 1.6`, but probably will work with any version started from `1.4`.
## Documentation
The docs can be found at [https://hexdocs.pm/phx_json_rpc][link-docs].
## Links
The package creation was inspired by some other repos:
- [json-rpc-laravel](https://github.com/avto-dev/json-rpc-laravel)
- [open-rpc](https://github.com/open-rpc/)
- [phoenix1.4-json-rpc](https://github.com/vruizext/phoenix1.4-json-rpc)## License
MIT. Please see the [license file](LICENSE.md) for more information.
[link-ci]: https://github.com/shirokovnv/phx_json_rpc/actions/workflows/ci.yml/badge.svg
[link-elixir]: https://elixir-lang.org/
[link-phoenix]: https://www.phoenixframework.org/
[link-guide]: https://hexdocs.pm/phx_json_rpc/PhxJsonRpc.html
[link-docs]: https://hexdocs.pm/phx_json_rpc
[link-shield]: https://img.shields.io/hexpm/v/phx_json_rpc
[link-hex]: https://hex.pm/packages/phx_json_rpc