Compare commits
3 Commits
v2.3
..
13ec1a72e9
| Author | SHA1 | Date | |
|---|---|---|---|
| 13ec1a72e9 | |||
| 1194fc63c6 | |||
| 574b6e1e07 |
+3
-2
@@ -23,7 +23,8 @@ EXPOSE 35729
|
||||
RUN apk --update --no-cache add \
|
||||
tini \
|
||||
tzdata \
|
||||
openssl
|
||||
openssl \
|
||||
&& apk --update --no-cache upgrade
|
||||
|
||||
# labels
|
||||
LABEL org.opencontainers.image.authors="Asif Bacchus <asif@asifbacchus.dev>"
|
||||
@@ -40,7 +41,7 @@ ENV PATH=/home/node/.npm-global/bin:$PATH
|
||||
ENV TZ="Etc/UTC"
|
||||
ENV LR_PORT=35729
|
||||
ENV LR_EXTS="html,xml,css,js,jsx,ts,tsx,php,py"
|
||||
ENV LR_EXCLUDE=".git/,.svn/,.vscode/,.idea/"
|
||||
ENV LR_EXCLUDE=".vscode/,.idea/,.tmp$,.swp$"
|
||||
ENV LR_DELAY=500
|
||||
ENV LR_DEBUG=true
|
||||
ENV LR_HTTPS=true
|
||||
|
||||
+13
-8
@@ -1,6 +1,5 @@
|
||||
// implement node-livereload over an HTTPS connection
|
||||
// implement node-livereload over an HTTP or HTTPS connection
|
||||
|
||||
// healthcheck function
|
||||
function healthcheck() {
|
||||
const express = require('express');
|
||||
const http = require('http');
|
||||
@@ -8,12 +7,12 @@ function healthcheck() {
|
||||
const app = express();
|
||||
const router = express.Router();
|
||||
|
||||
router.use((req, res, next) =>{
|
||||
router.use((req, res, next) => {
|
||||
res.header('Access-Control-Allow-Methods', 'GET');
|
||||
next();
|
||||
});
|
||||
|
||||
router.get('/health', (req, res) =>{
|
||||
router.get('/health', (req, res) => {
|
||||
res.status(200).send('Ok');
|
||||
});
|
||||
|
||||
@@ -23,17 +22,23 @@ function healthcheck() {
|
||||
hServer.listen(3000);
|
||||
}
|
||||
|
||||
// load livereload module
|
||||
// load modules
|
||||
const livereload = require('livereload');
|
||||
const fs = require('fs');
|
||||
|
||||
// process from environment variable as array and convert elements to RegEx objects
|
||||
const extraExclusions = process.env.LR_EXCLUDE.split(",");
|
||||
extraExclusions.forEach((exclusion, idx) => {
|
||||
extraExclusions[idx] = new RegExp(exclusion);
|
||||
});
|
||||
|
||||
// set createServer options
|
||||
const fs = require('fs');
|
||||
const options = {
|
||||
port: process.env.LR_PORT,
|
||||
exts: process.env.LR_EXTS,
|
||||
exclusions: process.env.LR_EXCLUDE,
|
||||
exclusions: extraExclusions,
|
||||
usePolling: true,
|
||||
delay: process.env.LR_DELAY,
|
||||
delay: process.env.LR_DELAY
|
||||
};
|
||||
|
||||
// set debugging output as per LR_DEBUG
|
||||
|
||||
Reference in New Issue
Block a user