Let key, cert as a file path
This commit is contained in:
parent
aa2d877064
commit
227fe0bab3
@ -1,3 +1,15 @@
|
||||
#! /usr/bin/env node
|
||||
var fs = require('fs');
|
||||
var path = require('path');
|
||||
var argv = require('minimist')(process.argv.slice(2));
|
||||
|
||||
function readFile(filePath) {
|
||||
return fs.readFileSync(path.resolve(process.cwd(), filePath), 'utf-8');
|
||||
}
|
||||
|
||||
if (argv.protocol === 'https') {
|
||||
argv.key = argv.key ? readFile(argv.key) : null;
|
||||
argv.cert = argv.cert ? readFile(argv.cert) : null;
|
||||
}
|
||||
|
||||
require('./server')(argv);
|
||||
|
Loading…
x
Reference in New Issue
Block a user