https://github.com/imbios/nextjs-flask-lab
https://github.com/imbios/nextjs-flask-lab
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/imbios/nextjs-flask-lab
- Owner: ImBIOS
- Created: 2023-07-27T08:18:29.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2023-07-27T11:50:20.000Z (almost 2 years ago)
- Last Synced: 2025-01-13T18:51:03.519Z (5 months ago)
- Language: TypeScript
- Homepage: https://nextjs-flask-lab.vercel.app
- Size: 107 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Next.js, Flask, Vercel Lab
I'm curious on capabilities of Next.js , Flask, and Vercel combination.
## Legends
- β : Success
- π΄ : Failed
- π : In Progress## Lab Objective
### 1. β Default template of Next.js, Flask, Vercel combination working properly
Commit:
Specifications (dir (url)):
- Python API directory: ./api (/api)
- Next.js API directory: -Note: Of course, it's working. It's the default template.
β Python API URL:
### 2. π΄ Use Next.js API with Flask API in the same project
#### 2.1. π΄ Use Next.js API (/api) with Flask API (/api-proxy) in the same project
Commit:
Specifications (dir (url)):
- Python directory: ./api (/api-proxy)
- Next.js directory: ./ (/api)Note:
Test number 2 failed, means all test below will also failed. Vercel can only have single serverless function source in the same project. either Next.js API or Flask API. Although it's working locally, but it's not working in Vercel.
β Next.js API URL:
π΄Python API URL:#### 2.2. π΄ Use Next.js API (/api) with Flask API (/api) in the same project
Not tested yet, but I think it will failed.
#### 2.3. π΄ Use Next.js API (/api) with Flask API (/api-proxy) in the same project, but Flask directory changed from default (./api) to (./python)
Not tested yet, but I think it will failed.
#### 2.4. π΄ Use Next.js API (/api) with Flask API (/api) in the same project, but Flask directory changed from default (./api) to (./python)
Not tested yet, but I think it will failed.
### 3. π Use Next.js as client side and Flask as server side
#### 3.1 π΄ Use Next.js as client side and Flask as server side, but Flask directory changed from default (./api) to (./python)
Not tested yet, but I think it will failed. It because I think Vercel recognize if there any serverless function in the project, is by detecting wether there is `api` directory or not. and if it has Next.js API, it will prefer to use Next.js API instead of Flask API.
#### 3.2 π΄ Use Next.js as client side and Flask as server side, but Flask API URL changed from default (./api) to (./python)
Commit:
Specifications (dir (url)):
- Python API directory: ./api (/python)
Note: It's working locally, but not working in Vercel.
π΄ Python API URL:
#### 3.3 π Use Next.js as client side and Flask as server side, Flask API URL is using /api but having multiple endpoint in single file (index.py)
Commit: -
Note: It's working locally, start to test in Vercel.