use beet::prelude::*;
fn main() {
App::new()
.add_plugins((
MinimalPlugins,
LogPlugin::default(),
CliPlugin::default(),
))
.add_systems(Startup, |mut commands: Commands| {
commands.spawn((
CliServer,
ExchangeSpawner::new_flow(|| {
(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();
}