From 8ee7bc8942d5d16a6aad0c6980afee28293f7fce Mon Sep 17 00:00:00 2001 From: ra0x3 Date: Mon, 16 Dec 2024 13:05:03 -0500 Subject: [PATCH] use new vercel config --- vercel.json | 35 ++++++++++++++++++++++------------- 1 file changed, 22 insertions(+), 13 deletions(-) diff --git a/vercel.json b/vercel.json index 6d3f75b..75d24d6 100644 --- a/vercel.json +++ b/vercel.json @@ -1,36 +1,45 @@ { + "version": 2, "builds": [ { - "src": "www/libx/package.json", - "use": "@vercel/static-build", + "src": "api/libx/app.py", + "use": "@vercel/python", "config": { - "installCommand": "yarn install", - "buildCommand": "yarn build", - "outputDirectory": "www/libx/dist" + "runtime": "python3.9", + "maxLambdaSize": "15mb", + "buildCommand": "pip install pipenv && pipenv install --deploy", + "startCommand": "ENV=production FLASK_APP=libx/app.py FLASK_RUN_HOST=0.0.0.0 FLASK_RUN_PORT=5000 flask run" } }, { - "src": "libx/app.py", - "use": "@vercel/python", + "src": "www/libx/package.json", + "use": "@vercel/static-build", "config": { - "runtime": "python3.12", - "installCommand": "pip install pipenv && pipenv install --deploy", - "startCommand": "ENV=production FLASK_APP=libx/app.py FLASK_RUN_HOST=0.0.0.0 FLASK_RUN_PORT=5000 flask run" + "distDir": "dist", + "buildCommand": "yarn --cwd www/libx install && yarn --cwd www/libx build", + "outputDirectory": "www/libx/dist" } } ], "routes": [ { "src": "/api/(.*)", - "dest": "/libx/app.py" + "dest": "/api/libx/app.py" }, { "src": "/static/(.*)", "dest": "/www/libx/dist/$1" }, + { + "handle": "filesystem" + }, { "src": "/(.*)", - "dest": "/libx/app.py" + "dest": "/api/libx/app.py" } - ] + ], + "env": { + "FLASK_APP": "libx/app.py", + "FLASK_ENV": "production" + } }