You've already forked AstralRinth
forked from didirus/AstralRinth
Staging Test
This commit is contained in:
@@ -47,6 +47,7 @@ async fn main() -> std::io::Result<()> {
|
||||
.service(routes::search_post)
|
||||
.service(routes::search_get)
|
||||
.service(routes::mod_page_get)
|
||||
.service(routes::mod_create_get)
|
||||
})
|
||||
.bind("127.0.0.1:8000")?
|
||||
.run()
|
||||
|
||||
@@ -1,9 +1,12 @@
|
||||
mod index;
|
||||
mod mod_page;
|
||||
mod search;
|
||||
mod mod_create;
|
||||
|
||||
pub use self::mod_page::mod_page_get;
|
||||
|
||||
pub use self::mod_create::mod_create_get;
|
||||
|
||||
pub use self::search::index_mods;
|
||||
pub use self::search::search_get;
|
||||
pub use self::search::search_post;
|
||||
|
||||
12
src/routes/mod_create.rs
Normal file
12
src/routes/mod_create.rs
Normal file
@@ -0,0 +1,12 @@
|
||||
use actix_web::{get, web, HttpResponse};
|
||||
use handlebars::*;
|
||||
|
||||
#[get("createmod")]
|
||||
pub async fn mod_create_get(hb: web::Data<Handlebars<'_>>) -> HttpResponse {
|
||||
let data = json!({
|
||||
"name": "Handlebars"
|
||||
});
|
||||
let body = hb.render("mod-create", &data).unwrap();
|
||||
|
||||
HttpResponse::Ok().body(body)
|
||||
}
|
||||
Reference in New Issue
Block a user