How to hide password from js file when connecting to database?

  • 0
    Kind. Using js, I connect to the database and perform the necessary manipulations, but the file contains a password, a login from the database. As far as I know, this data is hidden on the backend, but I don't understand this. Please tell me how to do this? And the second is the same question, when connecting to the API, where to hide the token?
    JavaScript Anonymous, Mar 9, 2020

  • 3 Answers
  • 0
    Hide on the backend.
    Anonymous

  • 0
    Read about environment variables
    Matthew Hull

  • 0
    Only on the backend, and strictly check who is knocking on you.
    Anonymous

Your Answer
To place the code, please use CodePen or similar tool. Thanks you!