-
Notifications
You must be signed in to change notification settings - Fork 260
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add docs for mounting Mesop app (#892)
- Loading branch information
1 parent
41c919c
commit 183450d
Showing
3 changed files
with
26 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Server integration | ||
|
||
Mesop allows you to integrate Mesop with other Python web servers like FastAPI or Flask by mounting the Mesop app which is a [WSGI](https://wsgi.readthedocs.io/en/latest/what.html) app. | ||
|
||
This enables you to do things like: | ||
|
||
- Serve local files (e.g. images) | ||
- Provide API endpoints (which can be called by the web component, etc.) | ||
|
||
## API | ||
|
||
The main API for doing this integration is the `create_wsgi_app` function. | ||
|
||
::: mesop.server.wsgi_app.create_wsgi_app | ||
|
||
## FastAPI example | ||
|
||
For a working example of using Mesop with FastAPI, please take a look at this repo: | ||
[https://github.com/wwwillchen/mesop-fastapi](https://github.com/wwwillchen/mesop-fastapi) | ||
|
||
> Note: you can apply similar steps to use any other web framework that allows you to mount a WSGI app. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters