jsonrpc-http-server

Rust http server using JSON-RPC 2.0.

Build Status

Documentation

Example

Cargo.toml

[dependencies] jsonrpc-http-server = "3.0"

main.rs

```rust extern crate jsonrpccore; extern crate jsonrpchttp_server;

use jsonrpccore::*; use jsonrpchttp_server::*;

struct SayHello; impl MethodCommand for SayHello { fn execute(&self, params: Option) -> Result { Ok(Value::String("hello".tostring())) } }

fn main() { let io = IoHandler::new(); io.addmethod("sayhello", SayHello); let server = Server::new(Arc::new(io)); server.start("127.0.0.1:3030".to_string(), AccessControlAllowOrigin::Null, 1); } ```