我是 deepstream.io 的新用户,我正在尝试从以下 deepstream 站点运行示例
https://deepstream.io/tutorials/core/getting-started-quickstart/
但是在启动 deepstream 服务器后,当我尝试访问以下 url
http://localhost:6020/deepstream
什么都没发生
我是 deepstream.io 的新用户,我正在尝试从以下 deepstream 站点运行示例
https://deepstream.io/tutorials/core/getting-started-quickstart/
但是在启动 deepstream 服务器后,当我尝试访问以下 url
http://localhost:6020/deepstream
什么都没发生
deepstream 是一个 websocket 服务器 - 需要使用 deepstream 客户端访问它(参见上面的答案)。在浏览器中输入 URL(或使用其他 HTTP 通信方式请求它)不会做任何事情。
要解决此问题,您需要将 index.html(或您命名的包含 deepstream 客户端连接的文件)托管到网络服务器。
当您连接到网络服务器以访问 index.html 时,它将执行 javascript 以启动 deepstream 客户端,然后该客户端将建立与运行在 ie 上的 deepstream 服务器的连接:默认端口 6020
希望这可以帮助。
Hi Im also a new user. Have you installed all the needed packages?
For me it works and my Index.html looks like this:
<!DOCTYPE html>
<html>
<head>
<script src="https://cdnjs.cloudflare.com/ajax/libs/deepstream.io-client-js/2.1.1/deepstream.js"></script>
</head>
<body>
<div id="app"></div>
<input type="text" />
<script type="text/javascript">
var client = deepstream('localhost:6020').login();
var record = client.record.getRecord('myname');
var input = document.querySelector('input');
console.log("helloooo");
record.set('firstname', input.value);
});
record.subscribe('firstname', function(value) {
input.value = value;
});
</script>
</body>
</html>