diff --git a/bin/app.js b/bin/app.js index fe90f677..7caa6071 100755 --- a/bin/app.js +++ b/bin/app.js @@ -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(); \ No newline at end of file diff --git a/bin/config.json b/bin/config.json index 9ef38e2b..0493c12d 100644 --- a/bin/config.json +++ b/bin/config.json @@ -10,7 +10,7 @@ "https": { "bind": "0.0.0.0", "port": 8443, - "key": "./bin/key.pem", - "cert": "./bin/cert.pem" + "key": "./key.pem", + "cert": "./cert.pem" } } \ No newline at end of file