This is a simple API that saves contact information of people.
You will need a Firebase project and firebase tools cli
npm install -g firebase-tools
You can follow the guide on Medium or clone this repository.
git clone git@github.com:dalenguyen/serverless-rest-api.git .
You need to change the firebase project name in .firebaserc file.
After that, you can log in to firebase in the terminal
firebase login
For the first time, you have deploy the hosting and functions together
firebase deploy
After that, you just need to deploy functions only
firebase deploy --only functions
If you have the declare namespace FirebaseFirestore, please comment the content of node_modules/@google_cloud/firestore/types/firestore.d.ts. After that you can test the api locally or deploy it to the cloud.
If you cannot do it, please "".firebaserc" has to be deleted and "firebase init" need to be run again." - Thanks to techboycr.