简体   繁体   中英

Configure node.js chat

I am trying to install and run this node.js chat: https://github.com/dual3nigma/Mejorando.la-Chat . When I type "npm install" and "node server" it starts, but with an Express error. I think the reason is in the config.json file.

This is my config.json file. I've only changed the db name and port of the config.sample.json file and added my twitter / facebook keys:

{
    "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

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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