简体   繁体   English

NodeJS与静态HTML

[英]NodeJS Vs Static HTML

I've a Java Rest API, and I'd like to implement a browser client. 我有一个Java Rest API,并且想实现一个浏览器客户端。 and I wonder which would be better and what are my trade offs in choosing between 我想知道哪种方法更好,在选择

  1. Static HTML files with backbone that would connect to the REST api and fill in the data feilds.. 具有主干的静态HTML文件,该主干将连接到REST api并填写数据域。
  2. NodeJS Application that would serve the same static files but load the data into the templates with nodejs modules before displaying them ? NodeJS应用程序将提供相同的静态文件,但在显示它们之前将数据加载到具有nodejs模块的模板中?

NodeJS is designed for server side. NodeJS是为服务器端设计的。 If you got already a Java server side which provides REST API, I recommend you to call directly this API from static HTML files or another client... it will be faster than reload data passing by NodeJS modules. 如果您已经有了提供REST API的Java服务器端,我建议您直接从静态HTML文件或其他客户端调用此API ...比重新加载NodeJS模块传递的数据要快。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM