English 中文(简体)
利用NODEJS和Enyo作为前端创建网络服务
原标题:Trying to create web services using NODEJS and enyo as a front end
  • 时间:2012-01-13 15:29:19
  •  标签:
  • node.js
  • enyo

我在诺琴蒂大学做了一个简单的网络浏览器。 万维网浏览器电灯将显示与/code>连接的世界。 但是,关于Success呼声的顶峰网络服务显示,从反应中发现了一幅 null。 我创建了一个固定的网页,并用我的当地海滨服务器对它装上了罚款。 为什么胜利的奥约总会从 no子的 sent子中抹掉了吗?

网站服务器

http.createServer(function(request, response) {
response.writeHead(200, {"Content-Type": "text/plain"});
response.write("Hello World");
response.end();
}).listen(8888);

我撰写了一个简单的“奥约”方案,当你发布《纽伦》时,它会提供网络服务,并在警示箱中显示结果。

enyo.kind({
name: "MyApps.MainApp",
kind: enyo.VFlexBox,

// comment code to load in data gfrom service
components: [
{name: "getName", kind: "WebService",
onSuccess: "gotName",
onFailure: "gotNameFailure",
url: "http://localhost:8888/"
},

{kind: "PageHeader", content: "Enyo FeedReader"},
{name:"curValue", content:("Sample Text")},
{kind: "Button", caption: "Action", onclick: "btnClick"} ],

// functions go here
create: function()
{
// call the default creat then do our stuff
this.inherited(arguments);
this.$.getName.call();
},

// Show output of server,
gotName: function(inSender, inResponse) {
this.$.button.setCaption("Success");
alert(inResponse );
},


// go here if it cold not connect to server
gotNameFailure: function(inSender, inResponse) {
this.$.button.setCaption("Failure"); },

// call the server
btnClick: function() {

this.$.getName.call(); }
});

Ted

最佳回答

你是否有必要写自己的网络服务? The enyo. 已有网络服务供你使用。

如果你确实需要你自己的话,我建议研究如何在以下样本项目中实施服务:

问题回答

暂无回答




相关问题
How to make Sequelize use singular table names

I have an model called User but Sequelize looks for the table USERS whenever I am trying to save in the DB. Does anyone know how to set Sequelize to use singular table names? Thanks.

What is Node.js? [closed]

I don t fully get what Node.js is all about. Maybe it s because I am mainly a web based business application developer. What is it and what is the use of it? My understanding so far is that: The ...

Clientside going serverside with node.js

I`ve been looking for a serverside language for some time, and python got my attention somewhat. But as I already know and love javascript, I now want learn to code on the server with js and node.js. ...

Can I use jQuery with Node.js?

Is it possible to use jQuery selectors/DOM manipulation on the server-side using Node.js?

How do I escape a string for a shell command in node?

In nodejs, the only way to execute external commands is via sys.exec(cmd). I d like to call an external command and give it data via stdin. In nodejs there does yet not appear to be a way to open a ...

热门标签