8000 GitHub - wwwillchen/mesop-fastapi
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

wwwillchen/mesop-fastapi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Mesop FastAPI Example

This example shows you how to use Mesop and FastAPI together.

The example has an HTTP endpoint /hello with FastAPI and a Mesop web component which fetches from the endpoint and displays the results in the UI.

How to run

This project uses uv so you will need to install it.

Development mode

You can run it like this:

DEBUG_MODE=true uv run main.py

But if you're developing locally, you will most likely want to enable auto-reloading with uvicorn.

Production mode

You can run it in production mode using the standard fastapi run CLI command:

uv run fastapi run

Note: uv run is just a wrapper to use the fastapi command with the uv virtual environment.

Limitations

Right now Mesop hot reload doesn't work when running with the commands above. You can use the regular Mesop CLI command mesop main.py which supports hot reloading, but then the fastapi server isn't running. If you'd like this supported, please upvote: mesop-dev/mesop#894.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published
0