https://www.youtube.com/watch?app=desktop&v=GyDAGGUn3Ck
### Clonar o projeto
git clone [email protected]:cristopherlima-dev/mern-vercel.git
### Preparação do diretório api
cd mern-vercel
mkdir api
cd api
npm init -y
npm i express
npm i --save-dev nodemon
npm i cors
### Preparação do diretório client
cd ..
npm create vite@latest
## Project name: client
## Select a framework: React
## Select a variant: JavaScript
cd client
npm i
{
"buldCommand": "cd client && npm install && npm run build",
"outputDirectory": "client/dist",
"framework": "vite",
"rewrites": [
{
"source": "/api/(.*)",
"destination": "/api/index.js"
}
]
}
cd api
npm run dev
- No browser: http://localhost:8000/api/hello
cd client
npm run dev
- No browser: http://localhost:3000
cd client
npm run build
- Add New Project
- Selecionar o projeto
mern-vercel
- Import
- Deploy