Code Monkey home page Code Monkey logo

Comments (9)

Myzumi avatar Myzumi commented on July 22, 2024 2

create a .env file and install 'dotenv' as package (npm i dotenv) and write in you main file

require('dotenv').config()

in the .env you can store variables, and if you upload it to a github don't forget to add the .env in the .gitignore

.env file conten be like:
CLIENT_ID=YOUSUPERSECRETCLIENTID
CLIENT_SECRET=YOUSUPERSECRETTOKEN

from discord-token-generator.

Savedyou avatar Savedyou commented on July 22, 2024

Did you restart your computer after after adding the environment variables? If you print the CLIENT_ID in your code I think you will find that the variables don't exist yet until restart. Hope this helps

from discord-token-generator.

yuta0801 avatar yuta0801 commented on July 22, 2024

Alternatively, you can set environment variables at runtime. This way doesn't need restarting computer, but instead needs to be set every time.

On Windows: set CLIENT_ID=id&& set CLIENT_SECRET=secret&& node server.js
Or Mac/Linux: CLIENT_ID=id CLIENT_SECRET=secret node server.js

from discord-token-generator.

pixeljellyfish avatar pixeljellyfish commented on July 22, 2024

i did restart my comptuer and where would i place the runtime variables

from discord-token-generator.

yuta0801 avatar yuta0801 commented on July 22, 2024

Just replace id with your client id and secret with your client secret
Let's say your client id is 000000000000000000 and your client secret id aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa, you can run this command:
On Windows: set CLIENT_ID=000000000000000000&& set CLIENT_SECRET=aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&& node server.js
Or Mac/Linux: CLIENT_ID=000000000000000000 CLIENT_SECRET=aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa node server.js

from discord-token-generator.

pixeljellyfish avatar pixeljellyfish commented on July 22, 2024

oh okay thanks

from discord-token-generator.

Savedyou avatar Savedyou commented on July 22, 2024

Untitled

This worked for me but needed a restart.

from discord-token-generator.

pixeljellyfish avatar pixeljellyfish commented on July 22, 2024

thats what i did and it doesn't work for me

from discord-token-generator.

pixeljellyfish avatar pixeljellyfish commented on July 22, 2024

ok thank you

from discord-token-generator.

Related Issues (14)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.