Skip to content

Add dotenv for local environment development#3

Open
matthewjamesr wants to merge 5 commits intoreneaaron:masterfrom
matthewjamesr:master
Open

Add dotenv for local environment development#3
matthewjamesr wants to merge 5 commits intoreneaaron:masterfrom
matthewjamesr:master

Conversation

@matthewjamesr
Copy link
Copy Markdown

This PR adds dotenv to allow .env files to be read on local environments, closing issue #2 .

@matthewjamesr
Copy link
Copy Markdown
Author

Also pushing changes to close issue #1 by changing http/https in callbackUrl dependent on new ENVIRONMENT key.

@reneaaron
Copy link
Copy Markdown
Owner

Awesome, thanks for your contribution. I'll try to get my hands on it later this week! 👍

Copy link
Copy Markdown
Owner

@reneaaron reneaaron left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks again for your contribution, let's tackle the open 2 issues.

Did you also test if this still works on Glitch?

Comment thread .gitignore
lerna-debug.log*
.pnpm-debug.log*

# Package lock
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why would you want to exclude the package-lock.json? This file is important for having the same versions across installs:

https://dev.to/adamklein/package-lock-json-in-git-or-not-50l5

Comment thread src/server/auth.js
const callbackUrl =`https://${req.get("host")}/do-login?${params.toString()}`;
let callbackUrl;

if (process.env.ENVRIONMENT === "production") {
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you change this section so there is less duplication?

const protocol = process.env.ENVRIONMENT === "production" ? "https" : "http";
const callbackUrl = protocol + ...;

Copy link
Copy Markdown

@ekzyis ekzyis Oct 10, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just stumbled over this PR from 2 years ago and noticed that there's a typo in ENVRIONMENT.

For anyone interested how I got here: 1 > 2 > 3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants