2012-06-09 4 views
2

Flatiron 프레임 워크와 HTTPS 연결을 사용하는 방법이 있습니까?Node.js Flatiron HTTPS 서버

업데이트 : HTTPS 서버 예제는 현재 github에서 사용할 수 있습니다. HTTPS이

{ 
    https: { 
    cert: 'path/to/cert.pem', 
    key: 'path/to/key.pem', 
    ca: 'path/to/ca.pem' 
    } 
} 

희망과 같아야 옵션으로 추가 할 수 있습니다 같은 참조

답변

1
var flatiron = require('flatiron'), 
    app = flatiron.app; 

app.use(flatiron.plugins.http, { 
    https: { 
    cert: 'path/to/cert.pem', 
    key: 'path/to/key.pem', 
    ca: 'path/to/ca.pem' 
    } 
}); 

app.router.get('/', function() { 
    this.res.writeHead(200, { 'Content-Type': 'text/plain' }); 
    this.res.end('Hello world!\n'); 
}); 

app.start(8080); 
+0

커밋을 병합 해 주셔서 감사합니다. –

2

docs 보이는이

+0

당신을 감사하는 데 도움이됩니다. 내가 어떻게 그것을 놓칠 수 있는지 전혀 모른다. –