Brykou/serverless-vercel-api

Serverless API Template, for Vercel hosting.

★ 0Forks 0GitHub ↗Compare

README

serverless-vercel-api

Serverless API Template, hosted with Vercel.

Dependencies

  • Vercel CLI
    • Required to emulate local environment (serverless functions).

Development

Build

# Install dependencies
yarn

# Start the server
vercel dev

Endpoints 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'

# ...

Production

Deploy

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

Contributors

robiiinosdependabot[bot]

Issues