你好,我的同事ColdFusion开发者!How to say来自共享node.js服务器的Hello World
我在学习node.js,并在http://pusher.com/有一个免费的沙箱帐户。 如果我查看API的访问,他们给pastable的html代码:
<!DOCTYPE html>
<head>
<title>Pusher Test</title>
<script src="http://js.pusherapp.com/1.9/pusher.min.js" type="text/javascript"></script>
<script type="text/javascript">
// Enable pusher logging - don't include this in production
Pusher.log = function(message) {
if (window.console && window.console.log) window.console.log(message);
};
// Flash fallback logging - don't include this in production
WEB_SOCKET_DEBUG = true;
var pusher = new Pusher('0xxxx0xxxxxxxxxxxx00');
var channel = pusher.subscribe('test_channel');
channel.bind('my_event', function(data) {
alert(data);
});
</script>
</head>
,我已经贴到这一个网页。
然后,他们给一些代码通过卷曲派:
curl -d "hello world" \
"http://api.pusherapp.com/apps/7499/channels/test_channel/events?"\
"name=my_event&"\
"body_md5=xxxxxxxxxxxxxxxxx&"\
"auth_version=1.0&"\
"auth_key=0xxxxxxxxxxxxxxx00&"\
"auth_timestamp=1318305150&"\
"auth_signature=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
,但我不认为我有卷曲。
问:我可以使用cfhttp吗?
是的,简而言之。为什么使用CF虽然,认为你想与节点工作?除非你在Windows上运行节点:$ –
嗯,我仍然试图让Hello World工作,所以我确信我做错了什么(如使用ColdFusion)。 –