Vercel Express and UI Webapp Example.
Live Demo - https://vercel-express-3.ngduc.vercel.app
$ npm install vercel -g
$ npm install
$ vercel
- Vercel will generate a ".vercel" directory, don't share or commit this one.
- After deploying, open your URL like this:
- If you're using Typescript, build your source directory, output to "app"
- Update package.json: "main": "app/index.js"
- Map API routes (/api/...) and static (UI) routes (/...).
- Environment variables - examples:
$ vercel secrets add my-mongodb-uri mongodb+srv://<user>:<password>@clusteridxxx.mongodb.net/<database-name>?retryWrites=true
- add "env" to vercel.json
{ "env": { "MONGODB_URI": "@my-mongodb-uri" }, ... }