-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a3602e6
commit 6b15242
Showing
4 changed files
with
51 additions
and
0 deletions.
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,26 @@ | ||
from pathlib import Path | ||
import streamlit as st | ||
from streamlit.web.bootstrap import run | ||
|
||
def streamlit_app(): | ||
# 这里导入并运行您的主 Streamlit 应用 | ||
import superexcel.main | ||
|
||
async def asgi_app(scope, receive, send): | ||
if scope["type"] == "http": | ||
run(streamlit_app, "", [], flag_options={}) | ||
return | ||
await send({ | ||
"type": "http.response.start", | ||
"status": 200, | ||
"headers": [ | ||
[b"content-type", b"text/plain"], | ||
], | ||
}) | ||
await send({ | ||
"type": "http.response.body", | ||
"body": b"Hello, World!", | ||
}) | ||
|
||
# 这个变量名很重要,Vercel 会查找它 | ||
app = asgi_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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/bin/bash | ||
python -m venv .venv | ||
source .venv/bin/activate | ||
pip install --upgrade pip | ||
pip install -r requirements.txt |
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 @@ | ||
python-3.10 |
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,19 @@ | ||
{ | ||
"version": 2, | ||
"builds": [ | ||
{ | ||
"src": "superexcel/main.py", | ||
"use": "@vercel/python", | ||
"config": { "maxLambdaSize": "15mb" } | ||
} | ||
], | ||
"routes": [ | ||
{ | ||
"src": "/(.*)", | ||
"dest": "superexcel/main.py" | ||
} | ||
], | ||
"env": { | ||
"PYTHONPATH": "/var/task" | ||
} | ||
} |