Closed jforaker closed 8 years ago
First thing that comes to mind is to make sure your settings.json
file have the right permissions:
chmod 777 settings.json
Then commit and push to heroku again.
Ok, I tried that as well running that command on the heroku shell.. still the same issue :/
Ok I just tried installing this on a fresh application on heroku, and got it to work. Must have been my pathing scheme was incorrect before. Basically I wanted to embed it with another api application on heroku, but i'm just having too much trouble getting both apps to run on the same server.
Fwiw - here is my setup that is working on heroku
index.js:
var express = require('express');
var xAdmin = require('express-admin');
var bodyParser = require('body-parser');
var path = require('path');
var prod = process.env.NODE_ENV === 'production';
var adminConfig = prod ? require('./config.js') : require(path.resolve(__dirname, './configDev.json'));
var config = {
dpath: './',
config: adminConfig,
settings: require('./settings'),
custom: require('./custom'),
users: require('./users')
};
var port = process.env.PORT || 3000;
xAdmin.init(config, function (err, admin) {
if (err) return console.log(err);
var app = express();
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({extended: true}));
app.use('/admin', admin);
app.get('/', function (req, res) {
res.send('Hello World');
});
app.listen(port, function () {
console.log('My awesome site listening on port 3000');
});
});
config.js
module.exports = {
"pg": {
"database": "d40v.....",
"user": "fjgk....",
"password": "L5IUh....",
"host": "ec2-.........compute-1.amazonaws.com",
"port": 5432,
"name": "d40v......",
"schema": "public",
"ssl": true
},
"app": {
"layouts": true,
"themes": true,
"languages": true,
"root": "/admin"
}
};
file structure:
Trying to add this to an app on Heroku, having some difficulties. My setup works locally but getting this error on Heroku:
I know its probably has to to with the read-only filesystem on heroku, but wondering if someone can point me in the right direction.
(also love the project, thanks!)