use beet::prelude::*;
fn main() {
App::new()
.add_plugins((
MinimalPlugins,
LogPlugin::default(),
RouterPlugin::default(),
))
.add_systems(Startup, |mut commands: Commands| {
commands.spawn((
HttpRouter,
InfallibleSequence,
children![
EndpointBuilder::get().with_handler(|| Response::ok_body(
"hello world",
"text/plain"
)),
EndpointBuilder::get().with_path("foo").with_handler(
|| {
Response::ok_body(
"<div>hello foo</div>",
"text/html",
)
},
),
],
));
})
.run();
}