StaticFiles to serve files from the given directory.
directory- directory path.
html- boolean to indicate to run in HTML serving.
from yaat import Yaat from yaat.staticfiles import StaticFiles app = Yaat() statics = StaticFiles(directory="./static") app.mount(statics, "/static")
Serving HTML Pages
You can serve in HTML by passing
True. When you serve the static file in HTML mode,
it will automatically loads
index.html for a directory if it exists.
statics = StaticFiles(directory="./static", html=True) app.mount(statics, "/")