- Make sure that you export your Google Cloud Credentials
export GOOGLE_APPLICATION_CREDENTIALS='PATH TO DEV_key.json'
- cd into your functions folder
- run
npm run build - Fix any errors then run
firebase emulators:start --only functions - Now open the PurdueHCR Webapp and naivgate to the token page. Log in, and copy the token.
- If you are not taken to a page with a token, make sure you are logged in and the url ends in /token.
- Open ARC and type into the following fields:
- Request URL: http://localhost:5001/purdue-hcr-test/us-central1/user/get
- or optionally
- Host: http://localhost:5001
- Path: /purdue-hcr-test/us-central1/user/get
- or optionally
- Parameters
- Headers
- Header Name: Authorization
- Header Value: (Paste the token)
- Headers
- Request URL: http://localhost:5001/purdue-hcr-test/us-central1/user/get
- Hit send, and if you scroll to the bottom, you should see the response from the server. 200 Success and a json object with your user's infromation.
- Congratulations! You are now able to host an emulator with the development API!
- Go to our API Documentation to see a list of available endpoints
- Make sure you have a bash termial installed.
- Git Bash (Windows)
- Terminal (MacOs)
- Open the bash terminal and make sure npm is installed.
- Talk to an exec member to download the Google Firebase Key, DEV_key.json, and save the path to this file as the environmental variable $GOOGLE_APPLICATION_CREDENTIALS.
export GOOGLE_APPLICATION_CREDENTIALS='PATH TO DEV_key.json'- Note you have to give it an absolute path. using shortcuts like '..' may not work
- Cd into the directory where you want the Cloud Functions to be saved and run the foloowing commands:
git clone https://github.com/PurdueHCR/PurdueHCR-CloudFunctions.git
git checkout dev
cd functions/
npm install -g firebase-tools
npm install firebase-functions@latest firebase-admin@latest --save
firebase login
npm install
npm run build
firebase emulators:start --only functions
- Open Google and search for Advanced REST Client (ARC) and install it.
- Now open the PurdueHCR Webapp and naivgate to the token page. Log in, and copy the token.
- If you are not taken to a page with a token, make sure you are logged in and the url ends in /token.
- Open ARC and type into the following fields:
- Request URL: http://localhost:5001/purdue-hcr-test/us-central1/user/get
- or optionally
- Host: http://localhost:5001
- Path: /purdue-hcr-test/us-central1/user/get
- or optionally
- Parameters
- Headers
- Header Name: Authorization
- Header Value: (Paste the token)
- Headers
- Request URL: http://localhost:5001/purdue-hcr-test/us-central1/user/get
- Hit send, and if you scroll to the bottom, you should see the response from the server. 200 Success and a json object with your user's infromation.
- Congratulations! You are now able to host an emulator with the development API!
- Go to our API Documentation to see a list of available endpoints