import logging

from fasthtml import serve

from myfasthtml.controls.Layout import Layout
from myfasthtml.myfastapp import create_app

logging.basicConfig(
  level=logging.DEBUG,  # Set logging level to DEBUG
  format='%(asctime)s - %(name)s - %(levelname)s - %(message)s',  # Log format
  datefmt='%Y-%m-%d %H:%M:%S',  # Timestamp format
)

app, rt = create_app(protect_routes=False, mount_auth_app=True, pico=False, title="MyFastHtml" )

@rt("/")
def index(session):
  layout = Layout(session, "Testing Layout", right_drawer=False)
  layout.set_footer("Goodbye World")
  return layout

if __name__ == "__main__":
  serve(port=5003)
