from bridget.common import *
from fasthtml.components import Buttonbridge_cfg.auto_show = True# app, brt, rt = get_app(show_logger=True, summary=True)
app, brt, rt = get_app() # Initialize Bridget environmentdef counter(n=0):
@rt('/inc')
def increment(n:int):
return Button(f"Count: {n+1}", value=f"{n+1}", name='n',
hx_post='/inc', hx_swap='outerHTML',
style=f"font-weight: bold")
return increment(n-1)
counter()