server: add --use-ssl option

This commit is contained in:
bordun 2020-05-05 14:50:17 +02:00
parent 7a4076f8a6
commit 420cd8c51b
8 changed files with 94 additions and 16 deletions

View file

@ -38,7 +38,7 @@ class DocsServer extends EventEmitter {
})
this.server.listen(0).on('listening', ()=>{
this.port = this.server.address().port
console.log('(INFO) Documentation server started, docs available at \n ' + address(this.port).join('\n '))
console.log('(INFO) Documentation server started, docs available at \n ' + address('http://', this.port).join('\n '))
this.emit('ready')
})
@ -51,11 +51,11 @@ class DocsServer extends EventEmitter {
if (!this.started || !this.port) {
this.start()
this.on('ready', ()=>{
open(address(this.port)[0] + this.home)
open(address('http://', this.port)[0] + this.home)
console.log('(INFO) Opening documentation with default browser...')
})
} else {
open(address(this.port)[0] + this.home)
open(address('http://', this.port)[0] + this.home)
console.log('(INFO) Opening documentation with default browser...')
}