let redirect; 

if (process.env.PORT === undefined) {
    redirect = `https://${process.env.R_HOST}`;
} else if (process.env.PORT !== undefined) {
    redirect = `http://${process.env.HOST}:${process.env.PORT}`;
}

module.exports = {
    host: process.env.HOST,
    port: process.env.PORT,
    fitbit: {
        client: {
            id: process.env.FB_ID,
            secret: process.env.FB_SECRET
        },
        uri: {
            authorization: 'https://www.fitbit.com/oauth2/authorize',
            token: 'https://api.fitbit.com/oauth2/token',
            redirect: `${redirect}/fitbit-authorization`
        },
        scope: 'activity heartrate location nutrition profile settings sleep social weight',
        responseType: 'code'
    },
    slack: {
        client: {
            id: process.env.SL_ID,
            secret: process.env.SL_SECRET
        },
        uri: {
            authorization: 'https://slack.com/oauth/authorize',
            token: 'https://slack.com/api/oauth.access',
            redirect: `${redirect}/slack-authorization`
        },
        scope: 'chat:write:bot'
    }
};
@@ -23,24 +23,26 @@
 process.env.
+R_
 PORT === und
@@ -44,32 +44,32 @@
 = undefined) %7B%0D%0A
-
     redirect = %60
@@ -120,24 +120,26 @@
 process.env.
+R_
 PORT !== und
@@ -202,24 +202,26 @@
 process.env.
+R_
 PORT%7D%60;%0D%0A%7D%0D%0A
@@ -267,24 +267,24 @@
 .env.HOST,%0D%0A
-
     port: pr
@@ -293,16 +293,18 @@
 ess.env.
+R_
 PORT,%0D%0A 
@@ -1149,8 +1149,243 @@
    %7D%0D%0A%7D;
+%0D%0A%0D%0A// https://www.fitbit.com/oauth2/authorize?client_id=2284LK&redirect_uri=http%253A%252F%252Fundefined%253A6910%252Ffitbit-authorization&response_type=code&scope=activity+heartrate+location+nutrition+profile+settings+sleep+social+weight&state

Fix redirect