ryde
jsx my life up
Ryde เป็นคนเดียวเฟรมเวิร์กเว็บไฟล์เดียวสำหรับ Rust
cargo add --git https://github.com/swlkr/ryde use ryde :: * ;
# [ router ]
fn router ( ) -> Router {
Router :: new ( ) . route ( "/" , get ( get_slash ) )
}
# [ main ]
async fn main ( ) {
serve ( "::1:9001" , router ( ) ) . await
}
async fn get_slash ( ) -> Html {
html ! {
<! DOCTYPE html>
<html>
<head>
<title>ryde with rust</title>
</head>
<body>
<div>you are here { url! ( get_slash ) } </div>
</body>
</html>
}
}โคลน repo และตรวจสอบส่วนที่เหลือของตัวอย่าง!
เป้าหมายของ Ryde คือการทำลายแผ่นหม้อไอน้ำทั้งหมด การกดแป้นพิมพ์ทุกครั้งที่คุณเขียนควรมีความหมายบางอย่าง เป้าหมายนี้เกิดขึ้นได้จากการใช้วิทยาศาสตร์ของมาโคร-โลกาภิวัตน์เพื่อกำหนด DSL การพัฒนาเว็บที่ด้านบนของ Axum, Tokio และ Sqlite