ab-livereload/build/livereload.js

30 lines
648 B
JavaScript
Raw Normal View History

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,
delay: process.env.LR_DELAY,
debug: process.env.LR_DEBUG
2021-07-22 16:43:17 -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);
server.watch('/watch')
2021-07-22 16:43:17 -06:00
//#EOF