diff --git a/Cargo.lock b/Cargo.lock index 77dd3ff..d7492c4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1051,7 +1051,7 @@ dependencies = [ [[package]] name = "peach-dyndns-server" -version = "0.1.0" +version = "0.1.2" dependencies = [ "clap-log-flag", "clap-verbosity-flag", diff --git a/Cargo.toml b/Cargo.toml index 520e528..ceb36c6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "peach-dyndns-server" -version = "0.1.0" +version = "0.1.2" authors = ["Michael Williams ", "Max Fowler "] edition = "2018" diff --git a/README.md b/README.md index 545f5ab..0c992b6 100644 --- a/README.md +++ b/README.md @@ -32,6 +32,18 @@ curl -X POST -H "Content-Type: application/json" -d '{"jsonrpc": "2.0", "method" curl -X POST -H "Content-Type: application/json" -d '{"jsonrpc": "2.0", "method": "is_domain_available", "params" : {"domain": "mirage.dyn.peachcloud.org" }, "id":1 }' 127.0.0.1:3002 ``` +# register_domain +``` +curl -X POST -H "Content-Type: application/json" -d '{"jsonrpc": "2.0", "method": "register_domain", "params" : {"domain": "mirage.dyn.peachcloud.org" }, "id":1 }' 127.0.0.1:3002 +``` + +# is_domain_available +``` +curl -X POST -H "Content-Type: application/json" -d '{"jsonrpc": "2.0", "method": "is_domain_available", "params" : {"domain": "mirage.dyn.peachcloud.org" }, "id":1 }' 127.0.0.1:3002 +``` + + + test peach-bind9 is running, ``` # this returns version of bind running diff --git a/src/lib.rs b/src/lib.rs index 2b0e477..df0d4dc 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -72,11 +72,9 @@ pub fn run() -> Result<(), BoxError> { let http_server = env::var("PEACH_DYNDNS_SERVER").unwrap_or_else(|_| "127.0.0.1:3001".to_string()); - info!("Starting JSON-RPC server on {}.", http_server); + info!("Starting JSON-RPC server on {}", http_server); let server = ServerBuilder::new(io) - .cors(DomainsValidation::AllowOnly(vec![ - AccessControlAllowOrigin::Null, - ])) + .cors(DomainsValidation::Disabled) .start_http( &http_server .parse()