简体   繁体   English

配置node.js聊天

[英]Configure node.js chat

I am trying to install and run this node.js chat: https://github.com/dual3nigma/Mejorando.la-Chat . 我正在尝试安装和运行此node.js聊天: https : //github.com/dual3nigma/Mejorando.la-Chat When I type "npm install" and "node server" it starts, but with an Express error. 当我键入“ npm install”和“节点服务器”时,它将启动,但是出现Express错误。 I think the reason is in the config.json file. 我认为原因是在config.json文件中。

This is my config.json file. 这是我的config.json文件。 I've only changed the db name and port of the config.sample.json file and added my twitter / facebook keys: 我只更改了config.sample.json文件的数据库名称和端口,并添加了我的twitter / facebook键:

{
    "port": 721,
    "host": "localhost",
    "db": {
        "name": "V1chatCCI"
    },
    "twitter": {
        "consumerKey": "XXXXXXXXXXXXXXXXXXXXXXXXXX",
        "consumerSecret": "XXXXXXXXXXXXXXXXXXXXXXXXXXXX"
    },
    "facebook": {
        "appId": "XXXXXXXXXXXXXXXXXXXXXXXX",
        "appSecret": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
    },
    "session": {
        "secret": "",
        "key": ""
    }, 
    "cookie": {
        "secret": ""
    },
    "secure": false,
    "loginsecure": false,
    "key": "",
    "cert": "",
    "sentry": "dsn"
}

What do I need to put in the session secret/key section? 我需要在会话机密/密钥部分中输入什么? The error on localhost:721 is: Express 500 Error: secret option required for sessions localhost:721上的错误是: Express 500 Error: secret option required for sessions

You should be able to put anything in those sections, as they're used used internally by express handling sessions. 您应该能够在这些部分中放置任何内容,因为快速处理会话在内部使用它们。 Any values (even just random strings) should fix your problem. 任何值(甚至只是随机字符串)都可以解决您的问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM