【发布时间】:2015-02-05 06:34:35
【问题描述】:
问题:
从这个简单的“教程”样式代码中,当我启动服务器时,它会将server started on 8080 打印到控制台然后结束。没有提供额外的错误或输入。
(...代码后的更多调试信息...)
var hapi = require('hapi');
var server = new hapi.Server(8080, "localhost", {
cache: {
engine: require('catbox-redis'),
options: {
host: "10.99.99.99", // fake ip
partition: 'hello',
password: "soopersekret" // not really, but you get the idea
}
} });
server.route({
method: 'GET',
path: '/',
handler: function (request, reply) {
reply('hello world');
} });
server.start(function () { console.log('server started on 8080'); });
已尝试其他调试:
- 在开发系统上使用
redis-cli,我们可以连接到主机并使用AUTH密码成功查看密钥,所以连接似乎正常。 - 在开发系统上运行本地redis实例,注释掉
host,服务器启动并提供内容 - 注释掉整个
cache配置部分会导致内容按预期提供
相信连接性和配置不是问题,而且对于如此简单得离谱的应用程序,并且没有来自应用程序的任何其他关于可能是什么问题的反馈,我们很难过。 :(
版本:节点 0.10.30;哈比 6.4.0;猫盒 3.1.0; catbox-redis 1.0.4
【问题讨论】:
-
你试过删除分区吗?此外,我认为您可能还需要
port,除非您的 redis 实例位于 6379 上。