vinay-jose commited on
Commit
ace03e7
·
verified ·
1 Parent(s): 7b04678

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -1
app.py CHANGED
@@ -1,4 +1,5 @@
1
  from fasthtml.common import *
 
2
 
3
  app,rt = fast_app()
4
 
@@ -6,6 +7,9 @@ app,rt = fast_app()
6
  def get(): return Div(P('Hello World!'), hx_get="/change")
7
 
8
  @rt('/change')
9
- def get(): return P('Nice to be here!')
 
 
 
10
 
11
  serve()
 
1
  from fasthtml.common import *
2
+ import random
3
 
4
  app,rt = fast_app()
5
 
 
7
  def get(): return Div(P('Hello World!'), hx_get="/change")
8
 
9
  @rt('/change')
10
+
11
+ def get():
12
+ texts = ['Nice to be here!', 'Hello World!', 'It\'s so random!']
13
+ return Div(P(random.choice(texts)), hx_get="/change")
14
 
15
  serve()