From fb98b92a15563cd1d79775e63f807e726385b922 Mon Sep 17 00:00:00 2001 From: Kyle Rubenok Date: Sun, 8 Dec 2019 16:00:46 -0500 Subject: [PATCH 01/10] Update to a supported node version --- .nvmrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.nvmrc b/.nvmrc index 4d0ffae7..73bffb03 100644 --- a/.nvmrc +++ b/.nvmrc @@ -1 +1 @@ -9.3.0 \ No newline at end of file +10.17.0 From bb3606f976da453ad74b1dd16a85ab16dbd562af Mon Sep 17 00:00:00 2001 From: Kyle Rubenok Date: Sun, 8 Dec 2019 16:00:51 -0500 Subject: [PATCH 02/10] Create Procfile --- Procfile | 1 + 1 file changed, 1 insertion(+) create mode 100644 Procfile diff --git a/Procfile b/Procfile new file mode 100644 index 00000000..4fb51ad8 --- /dev/null +++ b/Procfile @@ -0,0 +1 @@ +web: npm run build From 0162298ceaa02557aae87fdf96fbee72d24a9735 Mon Sep 17 00:00:00 2001 From: Kyle Rubenok Date: Sun, 8 Dec 2019 16:02:26 -0500 Subject: [PATCH 03/10] Specify node version in package --- package.json | 111 ++++++++++++++++++++++++++------------------------- 1 file changed, 57 insertions(+), 54 deletions(-) diff --git a/package.json b/package.json index f9d930eb..930fabc5 100644 --- a/package.json +++ b/package.json @@ -1,56 +1,59 @@ { - "name": "hackboard", - "version": "0.0.0", - "private": true, - "scripts": { - "start": "DEBUG=hackboard:* NODE_ENV=development nodemon --ignore gcp_creds.json ./bin/www.js", - "build": "NODE_ENV=deployment node ./bin/www.js", - "debug": "DEBUG=hackboard:* NODE_ENV=deployment nodemon --ignore gcp_creds.json ./bin/www.js", - "test": "DEBUG=hackboard:* NODE_ENV=test mocha --reporter spec tests/**.js --exit", - "seed": "NODE_ENV=development node ./seed/index.js", - "docs": "apidoc -i ./routes -o ./docs/api/", - "format": "prettier --write '**/*.js'", - "lint": "eslint --fix '**/*.js'" - }, - "dependencies": { - "@google-cloud/logging-winston": "^0.11.1", - "@google-cloud/storage": "^3.5.0", - "@sendgrid/mail": "^6.4.0", - "bcrypt": "^3.0.7", - "cookie-parser": "~1.4.4", - "cookie-session": "^2.0.0-beta.3", - "cors": "^2.8.5", - "cryptiles": "^4.1.3", - "debug": "~4.1.1", - "dotenv": "^8.2.0", - "express": "~4.17.1", - "express-validator": "^6.3.0", - "express-winston": "^2.6.0", - "handlebars": "^4.5.3", - "jsonwebtoken": "^8.5.1", - "memory-cache": "^0.2.0", - "mongoose": "^5.7.14", - "multer": "^1.4.2", - "passport": "^0.4.0", - "passport-local": "^1.0.0", - "q": "^1.5.1", - "qrcode": "^1.4.4", - "winston": "^2.4.4" - }, - "devDependencies": { - "@types/express": "^4.17.2", - "@types/google-cloud__storage": "^1.7.2", - "@types/mongodb": "^3.3.12", - "@types/mongoose": "^5.5.32", - "@types/multer": "^1.3.10", - "apidoc": "^0.17.7", - "chai": "^4.2.0", - "chai-http": "^4.3.0", - "eslint": "6.7.2", - "eslint-config-prettier": "6.7.0", - "eslint-plugin-prettier": "3.1.1", - "mocha": "^6.2.2", - "nodemon": "^1.19.4", - "prettier": "1.19.1" - } + "name": "hackboard", + "version": "1.6.2", + "private": true, + "scripts": { + "start": "DEBUG=hackboard:* NODE_ENV=development nodemon --ignore gcp_creds.json ./bin/www.js", + "build": "NODE_ENV=deployment node ./bin/www.js", + "debug": "DEBUG=hackboard:* NODE_ENV=deployment nodemon --ignore gcp_creds.json ./bin/www.js", + "test": "DEBUG=hackboard:* NODE_ENV=test mocha --reporter spec tests/**.js --exit", + "seed": "NODE_ENV=development node ./seed/index.js", + "docs": "apidoc -i ./routes -o ./docs/api/", + "format": "prettier --write '**/*.js'", + "lint": "eslint --fix '**/*.js'" + }, + "engines": { + "node": "10.17.0" + }, + "dependencies": { + "@google-cloud/logging-winston": "^0.11.1", + "@google-cloud/storage": "^3.5.0", + "@sendgrid/mail": "^6.4.0", + "bcrypt": "^3.0.7", + "cookie-parser": "~1.4.4", + "cookie-session": "^2.0.0-beta.3", + "cors": "^2.8.5", + "cryptiles": "^4.1.3", + "debug": "~4.1.1", + "dotenv": "^8.2.0", + "express": "~4.17.1", + "express-validator": "^6.3.0", + "express-winston": "^2.6.0", + "handlebars": "^4.5.3", + "jsonwebtoken": "^8.5.1", + "memory-cache": "^0.2.0", + "mongoose": "^5.7.14", + "multer": "^1.4.2", + "passport": "^0.4.0", + "passport-local": "^1.0.0", + "q": "^1.5.1", + "qrcode": "^1.4.4", + "winston": "^2.4.4" + }, + "devDependencies": { + "@types/express": "^4.17.2", + "@types/google-cloud__storage": "^1.7.2", + "@types/mongodb": "^3.3.12", + "@types/mongoose": "^5.5.32", + "@types/multer": "^1.3.10", + "apidoc": "^0.17.7", + "chai": "^4.2.0", + "chai-http": "^4.3.0", + "eslint": "6.7.2", + "eslint-config-prettier": "6.7.0", + "eslint-plugin-prettier": "3.1.1", + "mocha": "^6.2.2", + "nodemon": "^1.19.4", + "prettier": "1.19.1" + } } From c4e99613cb64079afc7eca545ca74d1c59b8eab2 Mon Sep 17 00:00:00 2001 From: Kyle Rubenok Date: Sun, 8 Dec 2019 17:05:09 -0500 Subject: [PATCH 04/10] Update Procfile --- Procfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Procfile b/Procfile index 4fb51ad8..e64aa339 100644 --- a/Procfile +++ b/Procfile @@ -1 +1 @@ -web: npm run build +web: NODE_ENV=deployment node ./bin/www.js From 6e713be7f7f99dc8a5e37b6b756db1ece125caf1 Mon Sep 17 00:00:00 2001 From: Kyle Rubenok Date: Sun, 8 Dec 2019 17:08:03 -0500 Subject: [PATCH 05/10] Rename npm scripts --- package.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 930fabc5..8a1d9ad9 100644 --- a/package.json +++ b/package.json @@ -1,10 +1,10 @@ { - "name": "hackboard", + "name": "hackerAPI", "version": "1.6.2", "private": true, "scripts": { - "start": "DEBUG=hackboard:* NODE_ENV=development nodemon --ignore gcp_creds.json ./bin/www.js", - "build": "NODE_ENV=deployment node ./bin/www.js", + "start:dev": "DEBUG=hackboard:* NODE_ENV=development nodemon --ignore gcp_creds.json ./bin/www.js", + "start": "NODE_ENV=deployment node ./bin/www.js", "debug": "DEBUG=hackboard:* NODE_ENV=deployment nodemon --ignore gcp_creds.json ./bin/www.js", "test": "DEBUG=hackboard:* NODE_ENV=test mocha --reporter spec tests/**.js --exit", "seed": "NODE_ENV=development node ./seed/index.js", From 3ef925f288edc64c267ae5702392e0fe2e0655b2 Mon Sep 17 00:00:00 2001 From: Kyle Rubenok Date: Sun, 8 Dec 2019 18:25:07 -0500 Subject: [PATCH 06/10] Clean up some kruft --- build.sh | 8 ---- deployment.yaml | 24 ----------- docs/deploy.md | 107 +++++++++++++++++----------------------------- package-lock.json | 4 +- release.sh | 89 -------------------------------------- 5 files changed, 41 insertions(+), 191 deletions(-) delete mode 100755 build.sh delete mode 100644 deployment.yaml delete mode 100755 release.sh diff --git a/build.sh b/build.sh deleted file mode 100755 index a0092672..00000000 --- a/build.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/usr/bin/env bash - -set -ex -GCR=gcr.io -PROJECT=mchacks-api -IMAGE=hackboard - -docker build -t ${GCR}/${PROJECT}/${IMAGE}:latest . \ No newline at end of file diff --git a/deployment.yaml b/deployment.yaml deleted file mode 100644 index d9adb40b..00000000 --- a/deployment.yaml +++ /dev/null @@ -1,24 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - name: hackboard -spec: - selector: - matchLabels: - run: hackboard - replicas: 1 - template: - metadata: - labels: - run: hackboard - spec: - volumes: - - name: secret-volume - secret: - secretName: hackboard-secret - containers: - - name: hackboard - image: gcr.io/mchacks-api/hackboard:latest - ports: - # - containerPort: 443 - - containerPort: 8080 \ No newline at end of file diff --git a/docs/deploy.md b/docs/deploy.md index 0b2c66dc..197faa17 100755 --- a/docs/deploy.md +++ b/docs/deploy.md @@ -1,71 +1,42 @@ # How to deploy -The following document acts as a quickstart guide on how to get your machine set up for deployment to the Google Cloud Container Cluster we have set up for the project. -*** Please note that the very first step before performing any of the steps below is to get permission from** @Kyle Rubenok **to be added to the Google Cloud project. -** The steps below are written with an Ubuntu OS in mind, however a Mac OS should also be able to perform the majority (if not all) of this given the UNIX environment.** - -## Installing Google Cloud SDK - -We begin by installing the Google Cloud CLI so we can easily deploy the application directly from the command line. Head over to [this link](https://cloud.google.com/sdk/) and click on the "Install for [OS]" button. - -## Setting up Google Cloud SDK - -Once you have the SDK installed, you can head over to your terminal and type in `gcloud init` to get started with the initial configuration of the SDK. This process is fairly intuitive and it takes you through a few steps to get your Google account linked to the CLI by logging into the web interface, as well as choosing a default project. **Note that it's a good idea to have your Google account already added to the project on Google Cloud by someone who has access before doing this, so that you can just select the hackboard project as your default instead of re-setting it later.** -In any case, we will be covering what commands you need to set our project as your default project. Type in the following lines in your terminal. - -```bash - > gcloud config set project hackboard6 - > gcloud config set compute/zone us-east1-b -``` - -## Installing Kubernetes - -Kubernetes is essentially Google's answer to efficient cloud clustering and scaling. We'll use both Kubernetes and Docker here. Kubernetes is essentially what we will use to manage our cluster of nodes that will run the application and allow us to scale it efficiently and easily. We get into the Docker details later. We will **not** be installing Kubernetes through the official installer, but rather use `gcloud` CLI to install it such that it automatically integrates with your credentials and save us some time setting it up. Run the following in your terminal. - -```bash - > gcloud components install kubectl -``` - -Hopefully you'll manage to walk through the simple setup quickly and have it up and running. The next step would be creating a cluster and setting it up with your application, but since we have already taken care of that, you'll want to run the below command to have your CLI connected to the cluster we have already created so that you can deploy to it. This command will attempt to retrieve the credentials for the 'hackboard' cluster we have set up and allow you to deploy to it. - -```bash - > gcloud container clusters get-credentials hackboard -``` - -## Intalling Docker CE - -We will be using the Community Edition of Docker for our application. Head over to [this link](https://www.docker.com/community-edition#download) and choose and specific installation for your own operating system; the setup is rather intuitive and skipped in this guide. Once you've got Docker installed, try running `docker —version` to make sure it's up and running. Note that docker has a 'daemon' service which should be running for the CLI to communicate with. I suggest following the steps in [this page](https://docs.docker.com/install/linux/linux-postinstall/#configure-docker-to-start-on-boot) to make sure the daemon is configured to start with your machine on start-up. Also, the previously mentioned note is mostly directed towards Linux users; the Windows and MacOS application (I believe) takes care of starting up the daemon for you once you see the green light in your indicators. - -**NOTE**: **The following steps are optional and meant for you to understand how the deployment actually works. You will not have to (and it is not recommended) to run all these steps manually everytime, as there will be a bash script setup to take care of all this.** - -## Building the Docker Image - -Every Docker container requires an image to run, which in turn requires a 'Dockerfile' as a set of instructions for creating it. Images can extend off of other images or be created from scratch. Due to the fact that the Docker community is very well established and has an 'almost' exhaustive list of base images on it already, we will be using an official Node JS image that provides the runtime for our application to run, and add to it as we wish. Below is the basic Dockerfile we have created so far: - -```bash - FROM node:carbon - ENV PORT 8080 - WORKDIR /usr/src/app - COPY package*.json ./ - ADD VERSION . - RUN npm install - COPY . . - EXPOSE 8080 - CMD [ "npm", "start" ] +This application can be most easily deployed via Heroku. A "deploy to heroku" button is available in the `README.md` file. Once in Heroku, several environment variables will need to be filled out including: + +```plain +##front-end server +FRONTEND_ADDRESS_DEPLOY= + +#The info for the deployment database +DB_ADDRESS_DEPLOY= +DB_USER_DEPLOY= +DB_PASS_DEPLOY= + +#Secret key for the cookies +COOKIE_SECRET= + +#Secret key for the invite tokens +JWT_INVITE_SECRET= + +#Reset password secret +JWT_RESET_PWD_SECRET= + +#Secret key fo account confirmation token +JWT_CONFIRM_ACC_SECRET= + +#mail server information +SENDGRID_API_KEY= +NO_REPLY_EMAIL= + +#Google Cloud Storage information +BUCKET_NAME= +TYPE= +PROJECT_ID=-api +PRIVATE_KEY_ID= +PRIVATE_KEY= +CLIENT_EMAIL= +CLIENT_ID= +AUTH_URI= +TOKEN_URI= +AUTH_PROVIDER_X509_CERT_URL= +CLIENT_X509_CERT_URL= ``` - -*If you have any questions regarding what Docker is and the difference between an image and a container, or anything else, I suggest reading online about it in detail before getting your hands dirty.* -To explain what is happening here, we are extending off of the LTS (carbon) version of the official Node image available on [Docker Hub](https://hub.docker.com/). Next we create an environment variable called PORT for our application. Environment variables can be created like this, or all added in a separate file. Next we declare the path `/usr/src/app` to be working directory (i.e. starting directory) of our image. Any operations from here onwards in the Dockerfile are performed in the set working directory. We will also copy the `package.json` files and the `VERSION` file with each build to make it easier to figure out which build is live via the application itself. Next we run the `npm install` command to install all dependencies, copy everything else left to copy to the image, and mark port `8080` to be exposed. This is an arbitrary value for now and can be replaced with any other port desired. Finally, set `npm start` as the starting command of the application which corresponds to `node ./bin/www` in our `package.json` file; this pretty much fires up the backend server. - -To be able to push the docker image into the Google Cloud Container Registry so that our clusters can access the images easily, we first need a defined naming/tagging scheme for the images. Below is the scheme we are using (which is the default and recommended way of naming images on Container Registry). The host name for Google Cloud Container Registry is `[gcr.io](http://gcr.io)` , our project-ID is `hackboard6` , image name is `hackboard` and the tag will correspond to the version of the current build `6.x.x` which we will also have it programatically increment and synchronize with every release on the master branch on GitHub. - - [HOSTNAME]/[PROJECT-ID]/[IMAGE][:TAG|@DIGEST] #template - gcr.io/hackboard6/hackboard:latest #example - -Every image has a `latest` version as well as all the other versions it was tagged as. The `latest` tag is automatically applied to (obviously) the latest build of the image, while the legacy builds are accessible via their specific version numbers. - -First you want to make sure there are no changes pushed to the master branch by anyone else before you deploy your local version. So perform a `git pull origin master`. - -We will first increment our `VERSION` file using a 3rd-party Docker image. - -*TO BE CONTINUED WHEN I HAVE THE MOOD.* \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 1a24e297..87f7cac4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { - "name": "hackboard", - "version": "0.0.0", + "name": "hackerAPI", + "version": "1.6.2", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/release.sh b/release.sh deleted file mode 100755 index 39eeda70..00000000 --- a/release.sh +++ /dev/null @@ -1,89 +0,0 @@ -#!/usr/bin/env bash -set -e -# Variables -GCR=gcr.io -PROJECT=mchacks-api -IMAGE=hackboard -MODE=$1 - -BRANCH="$(git symbolic-ref HEAD 2>/dev/null)" || BRANCH="(unnamed branch)" # detached HEAD -BRANCH=${BRANCH##refs/heads/} - -echo "Welcome to HackMcGill's HackerAPI Deployment Script!" -echo "===================================================" - -# Only allow release on master branch - -if [ ! ${BRANCH} = "master" ]; then - echo "Current branch: ${BRANCH}" - echo "ERROR: Release operation is only available on master branch." - echo "Deployment failed. Exiting." - exit 1 -fi -echo "Release modes:" -PS3='Please select one of the above release version modes:' -options=("Patch" "Minor" "Major" "Quit") -select opt in "${options[@]}" -do - case ${opt} in - "Patch") - MODE=patch - break - ;; - "Minor") - MODE=minor - break - ;; - "Major") - MODE=major - break - ;; - "Quit") - echo "Deployment cancelled. Exiting." - exit 1 - ;; - *) echo "Invalid option";; - esac -done - -# Update current branch -git pull origin master - -# bump version -docker run --rm -v "$PWD":/app treeder/bump ${MODE} -version=`cat VERSION` -echo "Version: ${version}" - -echo "================" -echo "Build Docker img" -echo "================" -# Build Docker image -./build.sh - -echo "==============" -echo "Tagging Github" -echo "==============" -# Tag Github -git add -A -git commit -m "version ${version}" -git tag -a "${version}" -m "version ${version}" -git push origin master -git push origin master --tags - -echo "===============" -echo "Update img tags" -echo "===============" -# Update the image tags -docker tag ${GCR}/${PROJECT}/${IMAGE}:latest ${GCR}/${PROJECT}/${IMAGE}:${version} -echo "================" -echo "Push DCR to GCR" -echo "================" -# Push to Docker Container Registry on Google Cloud -docker push ${GCR}/${PROJECT}/${IMAGE}:latest -docker push ${GCR}/${PROJECT}/${IMAGE}:${version} - -echo "===================" -echo "Update kube cluter" -echo "===================" -# Update deployment image on Kubernetes cluster -kubectl set image deployment/hackboard hackboard=${GCR}/${PROJECT}/${IMAGE}:${version} From 667fee9970305ea3b81fb38e4b9a25ad73737364 Mon Sep 17 00:00:00 2001 From: Kyle Rubenok Date: Sun, 8 Dec 2019 19:00:04 -0500 Subject: [PATCH 07/10] Add deploy to heroku button --- README.md | 4 +++ app.json | 77 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 81 insertions(+) create mode 100644 app.json diff --git a/README.md b/README.md index 7e873a2c..88f32e86 100755 --- a/README.md +++ b/README.md @@ -15,3 +15,7 @@ API for registration, live-site ## How to use and contribute See documentation here: + +## Deploy + +[![Deploy](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy) diff --git a/app.json b/app.json new file mode 100644 index 00000000..34439148 --- /dev/null +++ b/app.json @@ -0,0 +1,77 @@ +{ + "name": "HackMcGill HackerAPI", + "description": "API for registration, live-site", + "repository": "https://github.com/hackmcgill/hackerAPI", + "keywords": ["node", "express", "mongo", "react", "hackathon"], + "env": { + "FRONTEND_ADDRESS_DEPLOY": { + "description": "URL for application front end" + }, + "DB_ADDRESS_DEPLOY": { + "description": "Connection string for MongoDB" + }, + "DB_USER_DEPLOY": { + "description": "DB Username" + }, + "DB_PASS_DEPLOY": { + "description": "DB Password" + }, + "JWT_INVITE_SECRET": { + "generator": "secret" + }, + "JWT_RESET_PWD_SECRET": { + "generator": "secret" + }, + "JWT_CONFIRM_ACC_SECRET": { + "generator": "secret" + }, + "SENDGRID_API_KEY": { + "description": "Sendgrid API Key" + }, + "NO_REPLY_EMAIL": { + "description": "Noreply email address" + }, + "NO_REPLY_EMAIL": { + "description": "GCP Storage Bucket Name" + }, + "TYPE": { + "description": "GCP Account Type" + }, + "PROJECT_ID": { + "description": "GCP Project ID" + }, + "PRIVATE_KEY_ID": { + "description": "GCP Private Key ID" + }, + "PRIVATE_KEY": { + "description": "GCP Private Key" + }, + "CLIENT_EMAIL": { + "description": "GCP Client Email" + }, + "AUTH_URI": { + "description": "GCP Auth URI" + }, + "TOKEN_URI": { + "description": "GCP TOken URI" + }, + "AUTH_PROVIDER_X509_CERT_URL": { + "description": "GCP Provider Cert URL" + }, + "CLIENT_X509_CERT_URL": { + "description": "GCP Cert URL" + } + }, + "formation": { + "web": { + "quantity": 1, + "size": "free" + } + }, + "image": "heroku/nodejs", + "buildpacks": [ + { + "url": "https://github.com/heroku/heroku-buildpack-nodejs" + } + ] +} From 7c99107973617545e1e80829fe526b2a76d84415 Mon Sep 17 00:00:00 2001 From: Kyle Rubenok Date: Sun, 8 Dec 2019 19:14:00 -0500 Subject: [PATCH 08/10] Update script names --- Procfile | 2 +- package.json | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Procfile b/Procfile index e64aa339..e44ffb20 100644 --- a/Procfile +++ b/Procfile @@ -1 +1 @@ -web: NODE_ENV=deployment node ./bin/www.js +web: npm run deploy diff --git a/package.json b/package.json index 8a1d9ad9..56ee0d80 100644 --- a/package.json +++ b/package.json @@ -3,8 +3,8 @@ "version": "1.6.2", "private": true, "scripts": { - "start:dev": "DEBUG=hackboard:* NODE_ENV=development nodemon --ignore gcp_creds.json ./bin/www.js", - "start": "NODE_ENV=deployment node ./bin/www.js", + "start": "DEBUG=hackboard:* NODE_ENV=development nodemon --ignore gcp_creds.json ./bin/www.js", + "deploy": "NODE_ENV=deployment node ./bin/www.js", "debug": "DEBUG=hackboard:* NODE_ENV=deployment nodemon --ignore gcp_creds.json ./bin/www.js", "test": "DEBUG=hackboard:* NODE_ENV=test mocha --reporter spec tests/**.js --exit", "seed": "NODE_ENV=development node ./seed/index.js", From 702e41cee33c1fffaee93af2e6f96ae92802508a Mon Sep 17 00:00:00 2001 From: Kyle Rubenok Date: Mon, 9 Dec 2019 16:41:26 -0500 Subject: [PATCH 09/10] Add beta frontend to CORS list --- .env.example | 3 ++- app.js | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.env.example b/.env.example index d0e87bc0..3767c1f4 100644 --- a/.env.example +++ b/.env.example @@ -6,6 +6,7 @@ ADDRESS= #front-end server FRONTEND_ADDRESS_DEV=localhost:1337 FRONTEND_ADDRESS_DEPLOY=app.mchacks.ca +FRONTEND_ADDRESS_BETA=develop--mchacks-dashboard.netlify.com #The info for the deployment database DB_ADDRESS_DEPLOY= @@ -51,4 +52,4 @@ CLIENT_ID= AUTH_URI= TOKEN_URI= AUTH_PROVIDER_X509_CERT_URL= -CLIENT_X509_CERT_URL= \ No newline at end of file +CLIENT_X509_CERT_URL= diff --git a/app.js b/app.js index 327b1548..359c16cf 100755 --- a/app.js +++ b/app.js @@ -46,6 +46,7 @@ if (!Services.env.isProduction()) { corsOptions = { origin: [ `https://${process.env.FRONTEND_ADDRESS_DEPLOY}`, + `https://${process.env.FRONTEND_ADDRESS_DEVELOP}`, `https://docs.mchacks.ca` ], credentials: true From ac2cd8347c2814f383ee106c92fede0cbc8ace19 Mon Sep 17 00:00:00 2001 From: Kyle Rubenok Date: Mon, 9 Dec 2019 16:44:32 -0500 Subject: [PATCH 10/10] Type on CORS env variable --- app.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app.js b/app.js index 359c16cf..4de92284 100755 --- a/app.js +++ b/app.js @@ -46,7 +46,7 @@ if (!Services.env.isProduction()) { corsOptions = { origin: [ `https://${process.env.FRONTEND_ADDRESS_DEPLOY}`, - `https://${process.env.FRONTEND_ADDRESS_DEVELOP}`, + `https://${process.env.FRONTEND_ADDRESS_BETA}`, `https://docs.mchacks.ca` ], credentials: true