Comments (9)
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.
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.
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.
i did restart my comptuer and where would i place the runtime variables
from discord-token-generator.
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.
oh okay thanks
from discord-token-generator.
This worked for me but needed a restart.
from discord-token-generator.
thats what i did and it doesn't work for me
from discord-token-generator.
ok thank you
from discord-token-generator.
Related Issues (14)
- Unable to start server HOT 2
- token undefinedx HOT 1
- token undefined HOT 15
- missisng redirect uri in request HOT 1
- Invalid OAuth2 redirect_uri HOT 1
- Self work
- Hhhh
- help needed quick HOT 2
- Updated Version? HOT 1
- Please Help! HOT 1
- token is undefined HOT 6
- HELP HOT 4
- Thx
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from discord-token-generator.