-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix bin program https key file path error
- Loading branch information
Showing
2 changed files
with
15 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,17 @@ | ||
const NodeMediaServer = require(".."); | ||
#!/usr/bin/env node | ||
|
||
const fs = require("fs"); | ||
const path = require("path"); | ||
const config = require("./config.json"); | ||
const NodeMediaServer = require(".."); | ||
|
||
if (!fs.existsSync(config.https.key)) { | ||
config.https.key = path.join(__dirname, config.https.key); | ||
|
||
} | ||
if (!fs.existsSync(config.https.cert)) { | ||
config.https.cert = path.join(__dirname, config.https.cert); | ||
} | ||
|
||
const nms = new NodeMediaServer(config); | ||
nms.run(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters