Templates are rendered as plain text, not HTML #2238
-
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
And here's my entrypoint: #[launch]
async fn rocket() -> _ {
dotenv::dotenv().unwrap();
let path = env::var("TOML_SETTINGS_PATH")
.expect("Couldn't find env var `TOML_SETTINGS_PATH`, make sure it is set correctly.");
let backend = Mutex::new(recommended_backend(path).await);
rocket::build()
.mount("/", routes![show, update, test])
.manage(backend)
.attach(Template::fairing())
} |
Beta Was this translation helpful? Give feedback.
-
Templates don't need to be HTML, so there's no way for Rocket to know what kind of content they contain unless you specify it via a file extension. That is, naming your template something like
|
Beta Was this translation helpful? Give feedback.
Templates don't need to be HTML, so there's no way for Rocket to know what kind of content they contain unless you specify it via a file extension. That is, naming your template something like
index.html.hbs
instead of justindex.hbs
. This is specified in the docs: