简体   繁体   English

如何将 Node.js Web 服务器与 Apache Cordova 应用程序一起使用

[英]How to use a Node.js web server with an Apache Cordova Application

I have designed an Apache Cordova Application that uses a Node.js web server to pull data from a web API and allows the Javascript based project to use data pulled from this API.我设计了一个 Apache Cordova 应用程序,它使用 Node.js Web 服务器从 Web API 提取数据,并允许基于 Javascript 的项目使用从该 API 提取的数据。

Is there a way that I can use this Node web server across an iphone implementation of this cordova application?有没有办法可以在这个cordova应用程序的iphone实现中使用这个Node Web服务器? I am currently testing the application by pulling data from the website's API, hosting in on a node (ex. localhost:3000) and then pulling the data from that address in the JS file in my project.我目前正在测试应用程序,方法是从网站的 API 中提取数据,托管在节点(例如 localhost:3000)上,然后从我项目的 JS 文件中的该地址中提取数据。

How can I implement this server so that it can be used on an iOS mobile device?如何实现此服务器以便它可以在 iOS 移动设备上使用?

If you want to host your Node server somewhere so that devices can see it on a network, then Amazon AWS Elastic Beanstalk has an easy solution for that - just upload your Node project in a Zip file and they manage the server environment for you.如果您想在某个地方托管您的 Node 服务器,以便设备可以在网络上看到它,那么Amazon AWS Elastic Beanstalk有一个简单的解决方案 - 只需将您的 Node 项目上传到一个 Zip 文件中,他们就会为您管理服务器环境。

There's several other options out there depending on your needs, for example Heroku may be a good alternative.根据您的需要,还有其他几种选择,例如Heroku可能是一个不错的选择。

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

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