Preventing SQL injection in Node.js

前端 未结 5 1985
青春惊慌失措
青春惊慌失措 2020-11-22 16:48

Is it possible to prevent SQL injections in Node.js (preferably with a module) in the same way that PHP had Prepared Statements that protected against them.

If so, h

5条回答
  •  不要未来只要你来
    2020-11-22 17:16

    The easiest way is to handle all of your database interactions in its own module that you export to your routes. If your route has no context of the database then SQL can't touch it anyway.

提交回复
热议问题