parent
218c65e851
commit
4a0de56664
@ -1,11 +1,10 @@
|
|||||||
use actix_web::{get, web, HttpResponse};
|
use actix_web::{Error, get, web, HttpResponse};
|
||||||
use handlebars::Handlebars;
|
use handlebars::Handlebars;
|
||||||
use serde_json::json;
|
use serde_json::Value;
|
||||||
|
|
||||||
#[get("/help")]
|
use crate::render_error;
|
||||||
pub async fn get(hb: web::Data<Handlebars<'_>>) -> HttpResponse {
|
|
||||||
let data = json!({});
|
|
||||||
let body = hb.render("help", &data).unwrap();
|
|
||||||
|
|
||||||
HttpResponse::Ok().body(body)
|
#[get("/help")]
|
||||||
|
pub async fn get(hb: web::Data<Handlebars<'_>>) -> Result<HttpResponse, Error> {
|
||||||
|
Ok(HttpResponse::Ok().body(render_error!(hb, hb.render("help", &Value::Null))))
|
||||||
}
|
}
|
||||||
|
@ -1,13 +1,10 @@
|
|||||||
use actix_web::{get, web, HttpResponse};
|
use actix_web::{get, web, Error, HttpResponse};
|
||||||
use handlebars::Handlebars;
|
use handlebars::Handlebars;
|
||||||
use serde_json::json;
|
use serde_json::Value;
|
||||||
|
|
||||||
#[get("/")]
|
use crate::render_error;
|
||||||
pub async fn get(hb: web::Data<Handlebars<'_>>) -> HttpResponse {
|
|
||||||
let data = json!({
|
|
||||||
"name": "rewot"
|
|
||||||
});
|
|
||||||
let body = hb.render("index", &data).unwrap();
|
|
||||||
|
|
||||||
HttpResponse::Ok().body(body)
|
#[get("/")]
|
||||||
|
pub async fn get(hb: web::Data<Handlebars<'_>>) -> Result<HttpResponse, Error> {
|
||||||
|
Ok(HttpResponse::Ok().body(render_error!(hb, hb.render("index", &Value::Null))))
|
||||||
}
|
}
|
||||||
|
@ -1,13 +1,10 @@
|
|||||||
use actix_web::{get, web, HttpResponse};
|
use actix_web::{Error, get, web, HttpResponse};
|
||||||
use handlebars::Handlebars;
|
use handlebars::Handlebars;
|
||||||
use serde_json::json;
|
use serde_json::Value;
|
||||||
|
|
||||||
#[get("/submit")]
|
use crate::render_error;
|
||||||
pub async fn get(hb: web::Data<Handlebars<'_>>) -> HttpResponse {
|
|
||||||
let data = json!({
|
|
||||||
"name": "rewot"
|
|
||||||
});
|
|
||||||
let body = hb.render("submit", &data).unwrap();
|
|
||||||
|
|
||||||
HttpResponse::Ok().body(body)
|
#[get("/submit")]
|
||||||
|
pub async fn get(hb: web::Data<Handlebars<'_>>) -> Result<HttpResponse, Error> {
|
||||||
|
Ok(HttpResponse::Ok().body(render_error!(hb, hb.render("submit", &Value::Null))))
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in new issue