Skip to content
This repository was archived by the owner on Aug 24, 2020. It is now read-only.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Repository files navigation

PurdueHCR-CloudFunctions

How to run and test Cloud Functions on your computer!

  1. Make sure that you export your Google Cloud Credentials
    • export GOOGLE_APPLICATION_CREDENTIALS='PATH TO DEV_key.json'
  2. cd into your functions folder
  3. run npm run build
  4. Fix any errors then run firebase emulators:start --only functions
  5. 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.
  6. Open ARC and type into the following fields:
  7. 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.
  8. Congratulations! You are now able to host an emulator with the development API!

How to setup PurdueHCR Cloud Functions on your computer!

  1. Make sure you have a bash termial installed.
  2. Open the bash terminal and make sure npm is installed.
    • run npm -v. If the command is not found, install Node
      • Windows go to Node.js to install
      • Mac run brew install node
        • If brew is not installed, go to Homebrew and install it.
  3. 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
  4. 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
  1. Open Google and search for Advanced REST Client (ARC) and install it.
  2. 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.
  3. Open ARC and type into the following fields:
  4. 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.
  5. Congratulations! You are now able to host an emulator with the development API!

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages