Serverless API implementation for ChimpySwap Profile contract
- Vercel CLI
- Required to emulate local environment (serverless).
Documentation is available here.
You can configure your database URI for any development purpose by exporting an environment variable.
# Default: mongodb://localhost:27017/profile
export MONGO_URI = "mongodb://host:port/database";
You can configure (create/update/delete) the blacklist by editing the file located here.
Note: All blacklisted words must be LOWERCASE.
yarn global add vercel
# Install dependencies
yarn
# Build project
vercel dev
Endpoints are based on filename inside the api/
folder.
# api/version.ts
curl -X GET 'localhost:3000/api/version'
# ...
Deploy to production should be triggered by a webhook when a commit, or a pull-request is merged to master
.
If you need to force a deployment, use the following command:
vercel --prod