diff --git a/ROADMAP.md b/ROADMAP.md index 34e2ae09..3f2f2879 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -19,6 +19,7 @@ Rwf is brand new, but web development is ancient. Many features are missing or a - [ ] EventStreams - [ ] Integration tests - [ ] Support for multiple WebSocket controllers (`Comms::websocket` assumes only one) +- [ ] Multipart forms ## Dynanic templates @@ -48,6 +49,10 @@ Rwf is brand new, but web development is ancient. Many features are missing or a - [ ] Consider using granian (https://github.com/levkk/rwf/issues/4) +## Migrate from Ruby + +- [ ] Add support for running Rake apps (e.g. Rails) + ## Built-ins - [ ] Feature flags and experiments diff --git a/rwf/src/http/error.html b/rwf/src/http/error.html new file mode 100644 index 00000000..76ca623b --- /dev/null +++ b/rwf/src/http/error.html @@ -0,0 +1,31 @@ + + + + <%= title %> + + + +
+

<%= title %>

+
+
+
<%= message %>
+
+ + diff --git a/rwf/src/http/response.rs b/rwf/src/http/response.rs index f6350901..8fd61440 100644 --- a/rwf/src/http/response.rs +++ b/rwf/src/http/response.rs @@ -1,14 +1,20 @@ //! HTTP response. +use once_cell::sync::Lazy; use serde::Serialize; use std::collections::HashMap; use std::marker::Unpin; use tokio::io::{AsyncWrite, AsyncWriteExt}; use super::{head::Version, Body, Cookie, Cookies, Error, Headers, Request}; -use crate::view::TurboStream; +use crate::view::{Template, TurboStream}; use crate::{config::get_config, controller::Session}; +static ERROR_TEMPLATE: Lazy