上的NodeJS IOS / Android版 [英] NodeJS on IOS/Android

查看:618
本文介绍了上的NodeJS IOS / Android版的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

也许就是我要问是愚蠢的,一般我没有与服务器端如此的经历。

Maybe what I'm about to ask is stupid, generally I don't have so experience with server-side.

我建立一个角的Web应用程序,与服务器端的NodeJS。

I'm building an Angular web application, with nodeJS on the server-side.

我需要在服务器(Node.exe)将安装的设备本身(IOS / Android版),并会的NodeJS打开一个本地主机插座与设备进行通信。

I need that the server (Node.exe) will installed in the device itself (IOS/Android), and nodeJS will open a localhost socket to communicate with the device.

(据官方网站,只的NodeJS支持Windows / Mac的OS / Linux)的

(According to nodeJS official web site, nodeJS only support windows/Mac OS/Linux)

这是可能做到这一点?

如果不是,有另一个服务器我可以安装在该装置?

If not, there is another server can I install in the device?

推荐答案

你正在尝试实现,将您的设备变成一台服务器。

What you are trying to achieve, turns your device into a server.

一个服务器端语言是为了留在服务器上。
我真的不明白为什么你需要打开与自身通信设备上的本地主机插座。它是离线测试?你可以做到这一点,因为你有一台电脑和设备,并且都连接到同一网络。
我相信一个真正良好的开端将首先了解客户 - 服务器架构的概念。

A server side language is meant to stay on the server. I don't really see why you need to open a localhost socket on the device to communicate with itself. Is it for offline testing? You can do that since you have a computer and a device, and both are connected to the same network. I believe a really good start would be understanding the concept of the Client-Server architecture first.

但总之,使用所选的技术将成为实现客户端 - 服务器应用程序的正确方法:
服务器应该向客户提供的答案对他的请求。
所以在Node.js的(服务器端),写任何你想要与你的数据库进行通信(创建,读取,更新,删除),做加工定制等...
并返回一个结构化的答案。

But in short, the proper way of implementing a Client-Server app using your chosen technologies would be: A server should provide the client with answers to his requests. So in Node.js (server-side), write whatever you want to communicate with your database (Create, Read, Update, Delete), do custom processing, etc... and return a structured answer.

客户期望的答案对他的请求,应该处理code的答案。所以写在AngularJS(这是您的客户端语言)的程序将被安装在设备上。

The client is expecting answers to his requests, and is supposed to handle the answers in code. So the program written in AngularJS (which is your client-side language) will be installed on devices.

客户端必须知道服务器的答案的格式。它是纯文本? XML? JSON? ...

The client has to know the format of the server's answer. Is it plain text? XML? JSON? ...

这篇关于上的NodeJS IOS / Android版的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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