This directory is an example of creating serverless APIs in TypeScript and deploy on Vercel platform.
- Serverless functions written in
TypeScript
- Deployment on Vercel for main branch and pull requests
- Tests support using
Jest
- CI setup using GitHub Actions to run tests on every push to GitHub (on every branch)
- CI setup to run tests against Vercel Preview URLs and add them as check before PR could merge. See GitHub Action
- CI Setup to create a new release using
semantic-release
- Ability to compute function (
/address
) and also to make API calls (/currency
) - Sample business data is sourced using
Yelp GraphQL API
http://localhost:3000/api/hello?name=<string>
http://localhost:3000/api/address?total=<number>&type=<addressType>
http://localhost:3000/api/currency
http://localhost:3000/api/businesses
http://localhost:3000/api/business/random
- The value of
number
must be between1
and50
(inclusive) - The valid values for
addressTypes
arecity
,zipCode
Some examples are
http://localhost:3000/api/hello?name=harit
http://localhost:3000/api/address?total=20&type=zipCode
http://localhost:3000/api/address?total=10&type=city
http://localhost:3000/api/currency
http://localhost:3000/api/businesses
http://localhost:3000/api/business/random
- https://listbusinesses.vercel.app/api/hello?name=harit
- https://listbusinesses.vercel.app/api/address?total=20&type=zipCode
- https://listbusinesses.vercel.app/api/address?total=10&type=city
- https://listbusinesses.vercel.app/api/currency
- https://listbusinesses.vercel.app/api/businesses
- https://listbusinesses.vercel.app/api/business/random
- Clone this repository (or better fork it so that you can make changes in your repo)
- Run
yarn && yarn start
. This will kick-offvercel dev
so that you can start developing your features - Run
yarn test
to run tests