AnswerDotAI / fasthtml-example

Example fasthtml applications demonstrating a range of web programming techniques
Apache License 2.0
581 stars 82 forks source link

Question about variable scoping #9

Closed DallanQ closed 1 month ago

DallanQ commented 1 month ago

In the chatbot example the messages variable is declared at the script level. Does that mean that all requests would share the same set of messages, or is FastHTML doing something to limit the messages scope to a user session somehow? I'm trying to understand how FastHTML works under the hood. Thank you. The framework looks interesting.

jph00 commented 1 month ago

This example shares the messages across requests to keep it simple.