Home  >  Q&A  >  body text

javascript - Can people who visit your website easily see your entry file if they don’t have a backend password?

Like this, if I put the database password in the entry file, is it safe?
If it is not safe, then how to put the generally more important information more safely?

typechotypecho2676 days ago792

reply all(5)I'll reply

  • 我想大声告诉你

    我想大声告诉你2017-06-22 11:56:35

    No, unless I can see your source code

    reply
    0
  • 女神的闺蜜爱上我

    女神的闺蜜爱上我2017-06-22 11:56:35

    The code is parsed on the server side and will not be exposed to the front end

    reply
    0
  • 仅有的幸福

    仅有的幸福2017-06-22 11:56:35

    Unless you make the file that stores the database address/user name/database name/password public, or you leak the server password and other extreme circumstances (if you don’t have any security awareness)...otherwise you won’t be able to see it.

    reply
    0
  • 伊谢尔伦

    伊谢尔伦2017-06-22 11:56:35

    It is not safe. Writing such sensitive information in the code will risk being exposed by version control tools. It is generally better to use a separate configuration file or environment variable

    reply
    0
  • 迷茫

    迷茫2017-06-22 11:56:35

    Don’t write your password in the code. If you submit it to a public code base, it will be seen by others. Searching for password in github will bring up a lot of information

    This password leak has no impact on your project, but it will be troublesome if it happens to be a password you often use

    reply
    0
  • Cancelreply