From 82524d55f5c9c96b523f1c280c870e04e9fc0f0b Mon Sep 17 00:00:00 2001 From: Mateja Date: Thu, 15 Jul 2021 23:11:45 +0200 Subject: Setup `siteUrl` environment variable. --- server/config/env.js | 1 + server/controllers/transaction.js | 1 + 2 files changed, 2 insertions(+) diff --git a/server/config/env.js b/server/config/env.js index 441d6b6..e9349d2 100644 --- a/server/config/env.js +++ b/server/config/env.js @@ -3,6 +3,7 @@ module.exports = { port: process.env.PORT || 3000, mongoUrl: process.env.DB_CONN || "mongodb://localhost/mevn_ecommerce_db", masterKey: process.env.APP_SECRET || "you-should-use-something-different", + siteUrl: process.env.SITE_URL || `http://localhost:${process.env.PORT || 3000}`, paypalEnvironment: process.env.PAYPAL_ENVIRONMENT || "sandbox", paypalClientId: process.env.PAYPAL_CLIENT_ID || 'PAYPAL-SANDBOX-CLIENT-ID', paypalClientSecret: process.env.PAYPAL_CLIENT_SECRET || 'PAYPAL-SANDBOX-CLIENT-SECRET' diff --git a/server/controllers/transaction.js b/server/controllers/transaction.js index 119705e..a2226be 100644 --- a/server/controllers/transaction.js +++ b/server/controllers/transaction.js @@ -1,5 +1,6 @@ const paypal = require('@paypal/checkout-server-sdk'); const paypalClient = require('../config/paypal'); +const {siteUrl} = require('../config/env'); module.exports = { -- cgit v1.2.3