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
)
http://localhost:3000/api/hello?name=<string>
http://localhost:3000/api/address?total=<number>&type=<addressType>
http://localhost:3000/api/currency
- 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
- https://typescript-serverless-api-vercel-al75io70u-hhimanshu.vercel.app/api/hello?name=harit
- https://typescript-serverless-api-vercel-al75io70u-hhimanshu.vercel.app/api/address?total=20&type=zipCode
- https://typescript-serverless-api-vercel-al75io70u-hhimanshu.vercel.app/api/address?total=10&type=city
- https://typescript-serverless-api-vercel-al75io70u-hhimanshu.vercel.app/api/currency
- Clone this repository (or better fork it so that you can make changes in your repo)
- Run
yarn start
. This will kick-offvercel dev
so that you can start developing your features - Run
yarn test
to run tests