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

前端 未结 2 1968
天涯浪人
天涯浪人 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.

提交回复
热议问题