Skip to content

hhimanshu/businesses

Repository files navigation

Business & List API

This directory is an example of creating serverless APIs in TypeScript and deploy on Vercel platform.

Features

  • 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

Available APIs

Local

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 between 1 and 50(inclusive)
  • The valid values for addressTypes are city, 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

Production

Start Developing

  • Clone this repository (or better fork it so that you can make changes in your repo)
  • Run yarn && yarn start. This will kick-off vercel dev so that you can start developing your features
  • Run yarn test to run tests

Releases

No releases published

Packages

No packages published

Languages