Info
This post is auto-generated from RSS feed The Rust Programming Language Forum - Latest topics. Source: Velto 1.0.1 release
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.
- 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
+ }
tiny_http
(async_tiny is not at all complete yet).notify
, tokio-tungstenite
, tungstenite
, tokio
and futures-util
cratespathx::Normalize
Feedback is welcome.
1 post - 1 participant
🏷️ Rust_feed