For implementation related questions or technical support, please refer to the stackoverflow community.
Make sure these boxes are checked before submitting your issue -- thanks for reporting issues back to Parse Server!
Heroku + MongoLab
I have deployed parse on Heroku and I'm able to call the all cloud functions.
When call with '/' it's working showing 'I dream of being a web site.'
But when I call https://myapp-dev2.herokuapp.com/test in browser, it showing error
app.get('/', function(req, res) {
res.status(200).send('I dream of being a web site.');
});
app.get('/test', function(req, res) {
//res.sendFile('/app/public/index.html');
res.sendFile('public/index.html', { root: __dirname });
});
2016-03-18T15:12:54.734560+00:00 app[web.1]: TypeError: res.sendFile is not a function
2016-03-18T15:12:54.734603+00:00 app[web.1]: at Object.handle (/app/index.js:68:8)
2016-03-18T15:12:54.734613+00:00 app[web.1]: at next_layer (/app/node_modules/express/lib/router/route.js:103:13)
2016-03-18T15:12:54.734614+00:00 app[web.1]: at Route.dispatch (/app/node_modules/express/lib/router/route.js:107:5)
2016-03-18T15:12:54.734615+00:00 app[web.1]: at /app/node_modules/express/lib/router/index.js:205:24
2016-03-18T15:12:54.734615+00:00 app[web.1]: at Function.proto.process_params (/app/node_modules/express/lib/router/index.js:269:12)
2016-03-18T15:12:54.734616+00:00 app[web.1]: at next (/app/node_modules/express/lib/router/index.js:199:19)
2016-03-18T15:12:54.734616+00:00 app[web.1]: at next (/app/node_modules/express/lib/router/index.js:176:38)
2016-03-18T15:12:54.734617+00:00 app[web.1]: at next (/app/node_modules/express/lib/router/index.js:176:38)
2016-03-18T15:12:54.734617+00:00 app[web.1]: at Layer.expressInit [as handle] (/app/node_modules/express/lib/middleware/init.js:23:5)
2016-03-18T15:12:54.734618+00:00 app[web.1]: at trim_prefix (/app/node_modules/express/lib/router/index.js:240:15)
From the express docs: res.sendFile() is supported by Express v4.8.0 onwards
I assume this is your issue, as it's not related to parse-server.
You can update your package json to require a newer version of express.
This was the fix!!! glad I found this.
Update version to 4.8.0. Still getting error.
Most helpful comment
Update version to 4.8.0. Still getting error.