2021-07-22 16:43:17 -06:00
|
|
|
// implement node-livereload over an HTTPS connection
|
|
|
|
|
|
|
|
// load livereload module
|
|
|
|
let livereload = require('livereload');
|
|
|
|
|
|
|
|
// set createServer options
|
|
|
|
const fs = require('fs');
|
|
|
|
const options = {
|
|
|
|
port: process.env.LR_PORT,
|
|
|
|
exts: process.env.LR_EXTS,
|
|
|
|
exclusions: process.env.LR_EXCLUDE,
|
|
|
|
usePolling: true,
|
2021-07-22 21:21:59 -06:00
|
|
|
delay: process.env.LR_DELAY,
|
|
|
|
debug: process.env.LR_DEBUG
|
2021-07-22 16:43:17 -06:00
|
|
|
};
|
|
|
|
|
2021-07-23 13:31:01 -06:00
|
|
|
if (process.env.LR_HTTPS) {
|
|
|
|
options.https = {
|
|
|
|
cert: fs.readFileSync('/certs/fullchain.pem'),
|
|
|
|
key: fs.readFileSync('/certs/privkey.pem')
|
|
|
|
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2021-07-22 16:43:17 -06:00
|
|
|
// start server
|
|
|
|
let server = livereload.createServer(options);
|
2021-07-22 20:36:12 -06:00
|
|
|
server.watch('/watch')
|
2021-07-22 16:43:17 -06:00
|
|
|
|
|
|
|
//#EOF
|