我们正在寻找构建我们正在创建的应用程序前端的选项,并试图评估一个适合我们的工具,并为我们提供前进的最佳平台。
这是一个Node.js项目。我们最初的计划是使用Express并沿着这条路线走下去,但我们决定在开始这一阶段之前最好回顾一下现有的情况。我们的应用程序有几个区域,我们认为它们不适合单页模型,因为它们是从应用程序的角度相关的,而不是从视图的角度。
我们已经看到了一些可以用来构建客户端的框架,比如Backbone.js、Meteor等,还有AngularJS。
这可能是一个相当明显的问题,但我们似乎无法解释AngularJS是纯粹用于单页应用程序,还是可以用于多页应用程序,例如Express。
2013年7月17日更新 为了让大家了解情况,我会在整个过程中更新这个问题。现在我们将把所有东西都构建在一起,我们将看到它的表现如何。我们已经联系了一些在AngularJS方面比我们更有资格的人,并提出了关于拆分共享上下文的大型应用程序的问题,但在一个页面上工作可能太大了。
共识是,我们可以提供多个静态页面,并创建只处理这些页面的AngularJS应用程序,有效地创建一个SPA集合,并使用标准链接将这些应用程序链接在一起。现在我们的用例非常具体,因为我们的解决方案有几个应用程序,正如我所说的,我们将首先尝试单个代码库,然后从那里进行优化。
UPDATE 18 June 2016 The project fell of a cliff, so we never got round to getting too much done. We have picked it up again recently, but are no longer using angular and are using React instead. We are still using the architecture outlined in the previous update, where we use express and self contain apps, so for example, we have a /chat route in express that serves up our React chat app, we have another route /projects that serves up the projects app and so on. The way we are kinda looking at it is each app is an aggregate root in terms of its feature set, it needs to be able to standalone for it to be considered an app in itself. Technically, all the information is out there, its just basic express and whatever flavour of client side app building goodness you want to use.