如何从SailsJS做一个phonegap移动应用程序 [英] How to make a phonegap mobile app from SailsJS

查看:110
本文介绍了如何从SailsJS做一个phonegap移动应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在学习使用NodeJS和SailsJS,现在我已经创建了一个基本的网络应用程序,用户注册和列表系统。



基本上几乎完全一样的:
http://activityoverlord.herokuapp.com/ p>

现在,因为我从官方的SailsJS文档中读取,它也可以在phonegap使用sails build,将输出一个www文件夹。



- > https://github.com/coderaven/sails-docs/blob/master/What-Is-Sails.md



现在,我所有的看到的是链接器文件夹中的javascript,没有视图和whatnot。
我不知道我将如何在我的webapp上有与phonegap相同的ui和功能。



我将实现或重新创建一个新的ui的移动应用程序,并使用REST从api获取数据?



谢谢!

解决方案

phonegap转换客户端代码(html,js,css)。不是服务器代码,nodejs是在javascript,但作为服务器端的代码,所以你不能转换它。



最简单的方法是创建rest api(非常容易在sailsjs)。



或者对于iphone,你可以看看这个:
https://github.com/TooTallNate/NodObjC


I've been learning to use NodeJS and SailsJS just this day and now I have a created a basic web app with user signup and list system.

It is basically almost exactly the same as this: http://activityoverlord.herokuapp.com/

Now, since I have read from the official SailsJS documentation that it could be also be on phonegap using "sails build" that will output a "www" folder.

-> https://github.com/coderaven/sails-docs/blob/master/What-Is-Sails.md

Now, all I'm seeing are the javascript in the linker folder without the views and whatnots. I wonder how would I have exactly the same ui and functionality on phonegap that I have on my webapp.

Will I be implementing or be creating again a new ui for the mobile app and use REST to get the data from api? Or is there anything simpler i could do to have everything set up just like the one on my web app?

Thank you!

解决方案

phonegap converts clientside code (html,js,css). not serverside code, nodejs is in javascript but acts as serverside code so you cant convert it.

The most easy way would be creating rest api (very easy in sailsjs).

or if its for iphone, you can take a look at this: https://github.com/TooTallNate/NodObjC

这篇关于如何从SailsJS做一个phonegap移动应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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