Node.JS - How to hide secrets such as cookie secrets? [closed] - node.js

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 1 year ago.
Improve this question
I would like to avoid having secrets hard coded into my Node.JS application like this:
app.use(cookieParser('SECRETSECRETSECRET1!!!'));
How can I secrets in Node.JS?

Keep them in your .env file.
Then you can use packages like dotenv to load them into your js code
Update
As mentioned #Wyck, you should add .env to your .gitignore, since you don't want to make your env variables to be visible in your public/private repo

Related

How can I host this node.js project on GitHub? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 days ago.
Improve this question
I am making a fork of https://github.com/amethystnetwork-dev/Incognito, and I want to host it on github. can anyone help me with this? Whenever I open the page it just goes to the readme file...

Create a '~/.aws/credentials' file on Linux [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 1 year ago.
Improve this question
I'm setting up my computer to use Amazon's credential helper for Docker. There a step in which I should add stuff to ~/.aws/credentials, but I don't even have an idea how to create that .aws file or what it means to have a . right at the beginning.
just use the command mkdir .aws to create the .aws directory.

Vue secrets in production [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 2 years ago.
Improve this question
How do I secure secrets in the Vue for production environments? https://cli.vuejs.org/guide/mode-and-env.html is not secure as a solution. In production I am using NGINX and Node.js serving inside an ECS Docker container.

How to configure Editor js in Django? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
I am currently making a blogging site in python and django and for blog editing a saw many text editing plugins for django like ckeditor but the one. I liked is Editor.js
Can anyone tell me how to can I put the editor.js in Django the safest method possible?
Try the plugin to use Editor.js in the django admin area.
django-editorjs

keep express app running on Linux cloud server [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 6 years ago.
Improve this question
I am pretty new to node/express. In the past I've used Django and apache. Recently I developed an express app and it works great when I manually run it and test it. I've done research on how to keep a node app with mongo db up and running after logging out of the linux server and there seems to be a lot of different answers. Is there a single ideal agreed upon way of doing it?
You can use tools like pm2 to keep node process running

Resources