Preparation of template complete for learning API calls.
This commit is contained in:
+8
-5
@@ -12,9 +12,12 @@ async fn main() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async fn app_content() -> Html<String> {
|
async fn app_content() -> Html<String> {
|
||||||
Html(
|
let template = fs::read_to_string("./media/template.html")
|
||||||
fs::read_to_string("./media/template.html")
|
.unwrap_or_default()
|
||||||
.unwrap_or_default()
|
.to_string();
|
||||||
.to_string(),
|
let mut split = template.splitn(2, "<!-- Content -->");
|
||||||
)
|
let mut result = split.next().unwrap().to_string();
|
||||||
|
result.push_str("Table Here!<br>(This is the position in the template the Rust code identified for the API result.)");
|
||||||
|
result.push_str(split.next().unwrap());
|
||||||
|
Html(result)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user