velto 1.0.1
Version 1.0.1 of Velto has been released. Velto 1.0.1 makes the framework fully async, with live reload while staying with minimal boilerplate.
Velto 1.0.1 and 0.1.2 Comparison
- use velto::prelude::*;
-
- fn homepage(_req: &Request) -> Response<Cursor<Vec<u8>>> {
- render!("index.html", {
- "title" => "Welcome",
- "message" => "Hello, Velto!"
- })
- }
-
- fn main() {
- let mut app = App::new();
- route!(app, "/" => homepage);
- app.serve_static("static");
- app.run("127.0.0.1:8080");
- }
+ use velto::prelude::*;
+
+ fn homepage(_req: &Request) -> Response {
+ render!("index.html", {
+ "title" => "Welcome",
+ "message" => "Hello, Velto!"
+ })
+ }
+
+ #[tokio::main]
+ async fn main() -> std::io::Result<()> {
+ let mut app = App::new();
+ // app.enable_dev_mode(); Uncomment to enable dev mode
+ route!(app, "/" => homepage);
+ app.serve_static("static");
+ app.run("127.0.0.1:8080").await
+ }
Links
Notes
- Velto is now fully async, powered by async_tiny, an async implementation of
tiny_http
(async_tiny is not at all complete yet). - Live reload has been added, using the
notify
,tokio-tungstenite
,tungstenite
,tokio
andfutures-util
crates - Path traversal is protected against using
pathx::Normalize
Feedback is welcome.