I have a ruby script which is deployed on Heroku, which generates certain HTML files under my apps folder under /html.
I am trying to serve up these files from a NodeJS app, which is present under the same app.
My index.js looks like this :
var express = require('express');
var app = express();
app.set('port', (process.env.PORT || 5000));
app.use(express.static(__dirname + '/html'));
// views is directory for all template files
app.set('views', __dirname + '/views');
app.set('view engine', 'ejs');
app.get('/', function(request, response) {
var html = fs.readFileSync(__dirname+'/html/mytest.html', 'utf8')
response.send(html);
});
app.listen(app.get('port'), function() {
console.log('Node app is running on port', app.get('port'));
});
Now, even when I am reading the file on every request. I am getting the dummy copy of html file which I have committed with my github repo.
Is there a way if I can access this freshly overwritten copy of the html?
Thanks,