Can anyone guide me in the right direction?
I have a NodeJS app that is displaying an image. The image (saved in a local directory) gets updated after a certain time by an OpenCV script. However, when the image is updated, the update does not show on my app until I refresh the page. Does anyone know how I can have my image update automatically?
Here is how I serve the image from a directory as a static file:
var express = require('express');
var app = express();
var publicDir = require('path').join(__dirname,'/public');
app.use(express.static(publicDir));
With the code above, I can access my image using this directory: http://localhost/images/myImage.jpg
Does anyone have an idea of how I can have my image be updated automatically? Or recommend something different for my use case? I don't know if my approach to the problem is the right one.