Starlette
app (including FastAPI
, FastHTML
and other compatible apps). You make LangGraph Platform aware of this by providing a path to the app in your langgraph.json
configuration file.
Defining a custom app object lets you add any routes you’d like, so you can do anything from adding a /login
endpoint to writing an entire full-stack web-app, all deployed in a single LangGraph Server.
Below is an example using FastAPI.
webapp.py
file. If you are starting from scratch, you can create a new app from a template using the CLI.
langgraph.json
langgraph.json
configuration file. Make sure the path points to the FastAPI application instance app
in the webapp.py
file you created above.
localhost:2024/hello
in your browser (2024
is the default development port), you should see the /hello
endpoint returning {"Hello": "World"}
.