And then I should run node.js in putty?. Is this correct to deploy my app in a vps?
CodePudding user response:
No. If your Express app is in the public folder, then anyone can look at the source code of your backend by browsing the public folder, which means that if there are any security vulnerabilities in routes, or connection credentials or passwords in the source, someone who's interested enough would be able to identify them (and possibly crate problems for you) simply by opening the file. The express app should live in a separate folder, one not visible to the public. The public folder should only contain files that you want clients to be able to access easily.