basic echo HTTP server

This commit is contained in:
jfmonty2 committed 2026-11-22 06:14:06 -05:00
1 parent c86a898879
commit d976eebbbc
11 files changed
+151 -45

No files matched your search

+9 -2
View File
@@ -22,7 +22,8 @@ pub struct TestEnv {
impl TestEnv {
pub fn new() -> Result<TestEnv, CreddyError> {
let dir = tempfile::tempdir()?;
let config = AppConfig::load_from(dir.path().to_path_buf())?;
let path = dir.path().to_path_buf();
let config = AppConfig::load_from(path.clone(), path)?;
Ok(TestEnv { _dir: dir, config })
}
@@ -33,7 +34,13 @@ impl TestEnv {
/// Start the app against the test environment, as `main` would.
fn open_app(env: &TestEnv, cx: &mut TestAppContext) -> AnyWindowHandle {
let window = cx.update(|cx| launch(cx, env.config.clone(), AppSession::load(&env.config)));
let window = cx.update(|cx| {
launch(
cx,
env.config.clone(),
AppSession::load(&env.config),
)
});
// first frame, so that elements exist to be found
cx.update_window(window.into(), |_, window, cx| window.render_frame(cx)).unwrap();
window.into()