feat(api): Add api location as an env var
This commit is contained in:
committed by
mrugesh mohapatra
parent
ef18f5a931
commit
fec10caf67
@ -17,7 +17,7 @@ import _ from 'lodash';
|
|||||||
import jwt from 'jsonwebtoken';
|
import jwt from 'jsonwebtoken';
|
||||||
import generate from 'nanoid/generate';
|
import generate from 'nanoid/generate';
|
||||||
|
|
||||||
import { homeLocation } from '../../config/env';
|
import { homeLocation, apiLocation } from '../../config/env';
|
||||||
|
|
||||||
import { fixCompletedChallengeItem } from '../utils';
|
import { fixCompletedChallengeItem } from '../utils';
|
||||||
import { themes } from '../utils/themes';
|
import { themes } from '../utils/themes';
|
||||||
@ -596,7 +596,7 @@ module.exports = function(User) {
|
|||||||
}
|
}
|
||||||
const { id: loginToken, created: emailAuthLinkTTL } = token;
|
const { id: loginToken, created: emailAuthLinkTTL } = token;
|
||||||
const loginEmail = this.getEncodedEmail(newEmail ? newEmail : null);
|
const loginEmail = this.getEncodedEmail(newEmail ? newEmail : null);
|
||||||
const host = homeLocation;
|
const host = apiLocation;
|
||||||
const mailOptions = {
|
const mailOptions = {
|
||||||
type: 'email',
|
type: 'email',
|
||||||
to: newEmail ? newEmail : this.email,
|
to: newEmail ? newEmail : this.email,
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
module.exports = {
|
module.exports = {
|
||||||
homeLocation: process.env.HOME_LOCATION
|
homeLocation: process.env.HOME_LOCATION,
|
||||||
|
apiLocation: process.env.API_LOCATION
|
||||||
};
|
};
|
||||||
|
@ -20,3 +20,4 @@ DEBUG=true
|
|||||||
IMAGE_BASE_URL='https://s3.amazonaws.com/freecodecamp/images/'
|
IMAGE_BASE_URL='https://s3.amazonaws.com/freecodecamp/images/'
|
||||||
|
|
||||||
HOME_LOCATION='http://localhost:8000'
|
HOME_LOCATION='http://localhost:8000'
|
||||||
|
API_LOCATION='http://localhost:3000'
|
||||||
|
Reference in New Issue
Block a user