adding new post method and starting a search

master
lalanza808 5 years ago
parent 3186695906
commit aaf6325c23

@ -65,11 +65,17 @@ fn get_daemon_info() -> Json<GetInfoResult> {
Json(res.result)
}
#[post("/", format = "application/x-www-form-urlencoded")]
fn something() -> Template {
let res: GetInfo = issue_rpc(&"get_info", None)
.send().unwrap().json().unwrap();
Template::render("search", &res.result)
}
#[get("/")]
fn index() -> Template {
let res: GetInfo = issue_rpc(&"get_info", None)
.send().unwrap().json().unwrap();
// let res_json = serde_json::to_string(&res.result).unwrap();
Template::render("index", &res.result)
}
@ -87,7 +93,7 @@ fn main() {
Ok(_) => {
rocket::ignite()
.mount("/", routes![
index,
index, something,
get_daemon_info
])
.mount("/block", routes![

@ -7,7 +7,6 @@
<link rel="stylesheet" href="/static/css/normalize.css"/>
</head>
<body>
<div class="title">
<h1>Monero Block Explorer</h1>
</div>

Loading…
Cancel
Save