diff --git a/static/index.html b/static/index.html index a4a8fce..0a97362 100644 --- a/static/index.html +++ b/static/index.html @@ -1,5 +1,6 @@ + @@ -11,83 +12,81 @@ - - - + + + - -
-
-

+
+
+

Typed
Hypertext
Processor

-

+

Syntax, stdlib and types for PHP

-
- +
+ - -
-
-                    
-                        val person_id = POST::get("person_id") ?: die
-                        
-                        match Person::find_by_id(person_id)
-                        | Ok(person)
-                        {
-                            JSON::encode(person)
-                        }
-                        | Err(e)
-                        {
-                            JSON::encode(Obj {"error": e})
-                        }                        
-                    
-                
-
+ + + + + + + +
+
+                
+                    fun find_person(Str person_id) -> Result[Str] {
+                        let person_id = try person_id.parse[Int]()
+                        try Person::find_by_id(person_id)
+                    }
+
+                    let id = POST::get("person_id") ?: die
+                    let person = find_person(person_id: id) ?: die
+
+                    print(
+                        <a href="/person/reports/{person.id}">
+                            Hello {person.name}
+                        </div>
+                    )
+                
+            
+
- @@ -95,4 +94,5 @@ + \ No newline at end of file diff --git a/static/template.html b/static/template.html index f549995..1383a77 100644 --- a/static/template.html +++ b/static/template.html @@ -14,7 +14,7 @@ - -
-
-