【发布时间】:2014-05-27 02:42:02
【问题描述】:
尝试使用 generator-angular-fullstack https://github.com/DaftMonk/generator-angular-fullstack 运行 SSL 服务器。
但是,当我查看所有启用 SSL 的示例时,当我梳理代码时,它似乎并没有像 NodeJS 文档解释的那样初始化服务器:
var options = {
key: fs.readFileSync('test/fixtures/keys/agent2-key.pem'),
cert: fs.readFileSync('test/fixtures/keys/agent2-cert.pem')
};
// Create a service (the app object is just a callback).
var app = express();
// Create an HTTP service.
http.createServer(app).listen(80);
// Create an HTTPS service identical to the HTTP service.
https.createServer(options, app).listen(443);
有人成功过吗?除此之外,这个生成器似乎令人难以置信且易于使用。
【问题讨论】: