> ## Documentation Index
> Fetch the complete documentation index at: https://documentation.rebase.energy/llms.txt
> Use this file to discover all available pages before exploring further.

# Apps

> Serve data apps

{/*
Inspired by: 
https://www.numerous.com/docs
https://modal.com/docs/examples/serve_streamlit
*/}

```python
from pydantic import BaseModel
from fastapi.responses import HTMLResponse

from modal import Image, App, web_endpoint

image = Image.debian_slim().pip_install("boto3")
app = App(image=image)  # Note: prior to April 2024, "app" was called "stub"


class Item(BaseModel):
    name: str
    qty: int = 42


@app.function()
@web_endpoint(method="POST")
def f(item: Item):
    import boto3
    # do things with boto3...
    return HTMLResponse(f"<html>Hello, {item.name}!</html>")
```
