https://transformers-api.firebaseapp.com/
The web app uses a combination of Firebase Hosting and Cloud Functions to create a simple REST API that allows for CRUD functionality over Transformer objects.
- Clone repo.
- Run
npm install
in the root directory and/functions
directory. - Run
npm install -g firebase-tools
in the terminal. - Ensure you have a Firebase account.
- Ensure you have created a Firebase project in that account.
- Run
firebase login
- Download your service credentials which is in the form a JSON file (You can find the credentials by navigating to your newly created project in the Firebase Console). Rename it to "service-account-credentials.json" and place the file in the
/functions
directory of the project. - Initialize a Realtime Database in the Firebase Console for your project and copy the generated database URL into the
index.js
file located in the/functions
directory like so:
const credentials = require('./service-account-credentials.json');
admin.initializeApp({
credential: admin.credential.cert(credentials),
databaseURL: '<New Database URL>'
});
cd
in to the root directory of the repo and runfirebase serve --only functions, hosting
- The app should now be hosted on localhost:5000.
- To deploy changes to https://transformers-api.firebaseapp.com/ one would need the correct credentials for that project. Ask whomever is in charge of the account managing it to add your account as a member of the project.
- Follow step 6 of the Local Development instructions above.
cd
in to the root directory of the repo and runfirebase deploy
and follow the steps listed in the terminal, if any.