overhaul dioxus fullstack using a new implementation of server_fn This PR is a complete rewrite of dioxus fullstack designed to improve compatibility with axum and to fix a number of compilation errors based on feature flag unification plumbing through macros.
30 lines
487 B
Rust
30 lines
487 B
Rust
mod backend;
|
|
mod frontend;
|
|
|
|
use dioxus::prelude::*;
|
|
use frontend::*;
|
|
|
|
#[derive(Routable, PartialEq, Clone)]
|
|
enum Route {
|
|
#[layout(NavBar)]
|
|
#[route("/")]
|
|
DogView,
|
|
|
|
#[route("/favorites")]
|
|
Favorites,
|
|
}
|
|
|
|
fn main() {
|
|
#[cfg(not(feature = "server"))]
|
|
dioxus::fullstack::set_server_url("https://hot-dog.fly.dev");
|
|
|
|
dioxus::launch(app);
|
|
}
|
|
|
|
fn app() -> Element {
|
|
rsx! {
|
|
Stylesheet { href: asset!("/assets/main.css") }
|
|
Router::<Route> {}
|
|
}
|
|
}
|