为什么一个可能需要使用防爆preSS不是AngularJS? [英] Why would one want to use Express instead of AngularJS?

查看:125
本文介绍了为什么一个可能需要使用防爆preSS不是AngularJS?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

据我了解,前preSS所在的服务器和角度驻留在客户端上,但据我所知,角可以做的一切,防爆preSS能做的也就是


  • 路由

  • 与数据库交互

它种看起来也许为了需要一个AngularJS应用由Node.js的送达前preSS,但我不知道。

那么,什么是增加防爆preSS到AngularJS应用程序的好处是什么?


解决方案

有事情应该做服务器端(即前preSS,没有棱角),最主要的是用户输入验证 - 角,因为它是客户端,可以被篡改。

另外,如果你永远要提供比web应用程序其它接入类型(即移动应用程序),你可能需要一个API无论如何 - 前preSS能够做到这一点,角度不

最后,数据库访问 - 通常是角应用程序将需要连接到某种后端执行CRUD操作。你要么与托管DB去火力地堡一样,或者你会最终使用自己的数据库。后一种情况更受欢迎,你需要为防爆preSS(或类似)。

I understand that Express resides on the server and Angular resides on the client but, as far as I know, Angular can do everything that Express can do which is

  • routing
  • interacting with the database

It kind of seems like maybe Express is needed in order for an AngularJS app to be served by Node.js but I'm not sure.

So what are the benefits to adding Express to an AngularJS app?

解决方案

There are things which should be done server side (i.e. Express, not Angular), most notably user input validation - Angular, as it's client side, can be tampered.

Also, if you'll ever want to offer access type other than web app (i.e. mobile app), you'll probably need an API anyway - Express can do this, Angular don't.

Finally, database access - usually Angular app will need to connect to some kind of backend to perform CRUD operations. You'll either go with hosted DB like Firebase, or you'll end up using your own database. Latter scenario is more popular and you'll need Express (or similar) for that.

这篇关于为什么一个可能需要使用防爆preSS不是AngularJS?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆