// ============================================================================ // 051 — Static HTML Page // ============================================================================ // html() wraps content with the correct content-type for browsers. // Use single quotes for HTML attributes (double quotes delimit Soma strings). // // Serve: soma serve 051_html_page.cell // Test: open http://localhost:8080 // // Run: soma run 051_html_page.cell request GET / "" // Expect: (HTML output) cell StaticPage { face { signal request(method: String, path: String, body: String) -> String } on request(method: String, path: String, body: String) { // html() tells Soma to serve this as text/html // Note: use single quotes for HTML attributes inside Soma strings return html("
This page is served by a Soma cell. The entire app is one file.
Soma turns cells into web servers automatically.