JavaScript validation that works both on client and Node.js server?

前端 未结 2 1958
天涯浪人
天涯浪人 2020-12-25 14:17

What are my options for using the same JavaScript code to validate both on client side and on server side (Node.js)?

相关标签:
2条回答
  • 2020-12-25 14:51

    None, you are validating entirely different criteria on the server-side. Client-side validation is purely user-acceptance criteria and has nothing to do with security. Server-side validation almost exclusively concerned with security.

    0 讨论(0)
  • 2020-12-25 14:52

    Take a look at revalidator. It is described as "A cross-browser / node.js validator used by resourceful and flatiron."

    0 讨论(0)
提交回复
热议问题