Serverless API Template, hosted with Vercel.
- Vercel CLI
- Required to emulate local environment (serverless functions).
# Install dependencies
yarn
# Start the server
vercel devEndpoints are based on filename inside the api/ folder.
# api/index.ts
curl -X GET 'localhost:3000/api'
# api/time.ts
curl -X GET 'localhost:3000/api/time'
# ...Deployments 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:
# Push and deploy to production
vercel --prod