Sails.JS HTTP + HTTPS

后端 未结 8 2257
夕颜
夕颜 2021-01-02 04:49

I am trying to figure out how to lift a sails app that responds to both HTTP and HTTPS requests. I used the config/local.js method of configuring express like so (detailed h

8条回答
  •  Happy的楠姐
    2021-01-02 05:42

    As an update from 0.9 to 0.10 , the local.js file should now have

    ssl : {
    key: fs.readFileSync(‘server.key’),
    cert: fs.readFileSync(‘server.crt’)
    }
    

    instead of

    express : {
            serverOptions : {
                key: fs.readFileSync('ssl/server.key'),
                cert: fs.readFileSync('ssl/server.crt')
            }
        };
    

提交回复
热议问题