Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

about creds.js #4

Open
yogatanaya opened this issue Sep 14, 2018 · 1 comment
Open

about creds.js #4

yogatanaya opened this issue Sep 14, 2018 · 1 comment

Comments

@yogatanaya
Copy link

please give me tutorials in create the file of creds.js

@Miikis
Copy link

Miikis commented Nov 21, 2018

Hey @yogatanaya,

You've probably already figured it out by now but I'll answer this for posterity.
creds.js contains something like this:

export const creds = {
    username: "GeekLaunch",
    password: "Password1!"
}

Food for Thought

  • If you're using a version-control system, you don't want to check creds.js into it, as it contains sensitive data.
  • Rather, you'll want to create a file called .env, in the root of your directory, and put the credentials-info in there. Like so:
USERNAME=GeekLaunch
PASSWORD=Password1!
  • Subsequently, you can use the npm package dotenv to load the data in that .env file as environment variables. You would then be able to access the .env data by doing something like process.env.USERNAME or process.env.PASSWORD.
  • Finally, don't forget to ignore .env from your version-control system.

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

No branches or pull requests

2 participants