Sufast/Documentation
API Reference
API Reference
Complete reference for all Sufast classes, methods, and decorators.
App Class
The main application class for creating Sufast applications
Constructor
App Constructorpython
from sufast import App
app = App(
debug=False, # Enable debug mode
host="127.0.0.1", # Default host
port=8080, # Default port
cors=True # Enable CORS
)Methods
| Method | Description | Parameters |
|---|---|---|
| run() | Start the application server | host, port, debug |
| add_middleware() | Add middleware to the application | middleware_class, **options |
| include_router() | Include a router with prefix | router, prefix |
Example
Basic App Usagepython
from sufast import App
app = App(debug=True)
@app.get("/")
def home():
return {"message": "Hello World"}
# Start the server
app.run(host="0.0.0.0", port=8080)