feat(api): Add api location as an env var

This commit is contained in:
Bouncey
2018-08-30 11:27:06 +01:00
committed by mrugesh mohapatra
parent ef18f5a931
commit fec10caf67
3 changed files with 5 additions and 3 deletions

View File

@ -17,7 +17,7 @@ import _ from 'lodash';
import jwt from 'jsonwebtoken';
import generate from 'nanoid/generate';
import { homeLocation } from '../../config/env';
import { homeLocation, apiLocation } from '../../config/env';
import { fixCompletedChallengeItem } from '../utils';
import { themes } from '../utils/themes';
@ -596,7 +596,7 @@ module.exports = function(User) {
}
const { id: loginToken, created: emailAuthLinkTTL } = token;
const loginEmail = this.getEncodedEmail(newEmail ? newEmail : null);
const host = homeLocation;
const host = apiLocation;
const mailOptions = {
type: 'email',
to: newEmail ? newEmail : this.email,

View File

@ -1,3 +1,4 @@
module.exports = {
homeLocation: process.env.HOME_LOCATION
homeLocation: process.env.HOME_LOCATION,
apiLocation: process.env.API_LOCATION
};

View File

@ -20,3 +20,4 @@ DEBUG=true
IMAGE_BASE_URL='https://s3.amazonaws.com/freecodecamp/images/'
HOME_LOCATION='http://localhost:8000'
API_LOCATION='http://localhost:3000'