API to RSVP to wedding invitation.
Built with Express.js and Firebase Cloud Functions. Invitations are saved in Firebase Cloud Firestore.
Setup instructions copied and adapted from Firebase SDK for Cloud Functions Quickstart.
Clone or download this repo.
Create a Firebase Project on the Firebase Console.
Set up your Firebase project by running firebase use --add
, select your Project ID and follow the instructions.
You need to have installed the Firebase CLI, and it always helps to be on the latest version. Run:
npm install -g firebase-tools
Doesn't work? You may need to change npm permissions.
First you need to install the npm
dependencies of the functions:
cd functions && npm install; cd ..
To run functions locally follow this guide and make sure you complete the Setup admin credentials step.
Start serving your project locally using firebase serve
Open the app in a browser at http://localhost:5000/api/v1/invitations/.
A page containing the response for the GET invitations
endpoint will be displayed.
You can find all the endpoints at ENDPOINTS.md.
First you need to install the npm
dependencies of the functions:
cd functions && npm install; cd ..
This installs locally the Firebase SDK and the Firebase Functions SDK.
Deploy to Firebase using the following command:
firebase deploy
The first time you call
firebase deploy
on a new project with Functions will take longer than usual. Since Node's engine version is set to 10 onpackage.json
you might need to enable Billing for your Firebase's project, otherwise you won't be able to deploy your project to prod. Feel free to try different Node's versions.
After deploying the function you can open the following URL in your browser:
https://<your-project-id>.firebaseapp.com/api/v1/invitations
A page containing the response for the GET invitations
endpoint will be displayed.