1

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,

1 Answer 1

1

Heroku file system is mostly read-only with a few exceptions.

Please check out this answer and for real consider using S3 which seems to be a pretty straightforward solution.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.