且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何将node.js应用程序转换为cordova

更新时间:2023-02-08 18:18:59

基本上,这是一个概念问题。
Node.js是一种专门用于后端的技术,并且诸如扩展某些服务/功能之类的一些用法。
当您谈论localhost:8080时,您在说应该在您的node.js实现中使用服务器(Amazon,Azure,您自己的服务器,nodejitsu等),公共页面或客户端应使用的页面将添加到phonegap中,尤其是在您的 www 中>目录,并且应该为您的服务器(Amazon,您自己的服务器,nodejitsu等)更改localhost:8080的引用,并且 www 目录中的文件可能具有引用(通过 GET POST 从服务器检索数据。请记住, Crossdomain 问题不会在phonegap上发生(也许在
和Phonegap是使用HTML5,jquery,CSS3和其他相关技术开发前端的框架技术。
对于您的特定情况, node_modules 也应该安装在服务器中,而不是在phonegap项目上。

Basically, is a concept problem. Node.js is a technology specialised in backend and some of usages like extend some services/functions, etc. When you talk of a localhost:8080 you are talking that your node.js implementation should be in a server (Amazon, Azure, your own server, nodejitsu, etc), and the public pages or the pages that the client should consume will be added into phonegap, specifically in your www directory and the references for localhost:8080 should be changed for your server (Amazon, your own server, nodejitsu, etc), and the files on your www directory could have references (via GET or POST to retrieve the data from the server. Remember, the Crossdomain problem doesn't happens on phonegap (maybe in a local enviroment should occur). And Phonegap is a framework to develop front-end with HTML5, jquery, CSS3 and other releated technologies. For your specific case the node_modules should be installed in the server too, not on the phonegap project.