Keystone和openshift,得到503错误

时间:2015-04-15 11:12:13

标签: mongodb openshift keystone

有人可以帮我在我的openshift应用程序上安装keystone.js吗?

我已将所有文件推送到遥控器,但在浏览到我的页面时出现503错误。我对Openshift很陌生,有谁可以请我指出正确的方向?

我尝试将keystone.init更改为:

var connectionString = process.env.OPENSHIFT_MONGODB_DB_USERNAME + ":" +  process.env.OPENSHIFT_MONGODB_DB_PASSWORD + "@" + process.env.OPENSHIFT_MONGODB_DB_HOST + dbName;

console.log(connectionString);

keystone.set('mongo', connectionString);

keystone.init({
'mongo': connectionString,

仍然没有快乐,我也没有得到任何控制台错误。

任何建议都非常感谢。

更新:检查日志并找到以下内容:

SyntaxError: Unexpected end of input
    at Module._compile (module.js:439:25)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.require (module.js:364:17)
    at require (module.js:380:17)
    at Object.<anonymous> (/var/lib/openshift/5501b0c04382ecfefe0000a2/app-root/runtime/repo/node_modules/keystone/index.js:3:6)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
DEBUG: Program node keystone.js exited with code 8
DEBUG: Starting child process with 'node keystone.js'
hit me
/var/lib/openshift/5501b0c04382ecfefe0000a2/app-root/runtime/repo/node_modules/underscore/underscore.js:561
});

SyntaxError: Unexpected end of input
    at Module._compile (module.js:439:25)

Keystone.js

// Simulate config options from your production environment by
// customising the .env file in your project's root folder.

// Require keystone
var keystone = require('keystone');

// Initialise Keystone with your project's configuration.
// See http://keystonejs.com/guide/config for available options
// and documentation.

var dbName = "node";

var connectionString = process.env.OPENSHIFT_MONGODB_DB_USERNAME + ":" +  process.env.OPENSHIFT_MONGODB_DB_PASSWORD + "@" + process.env.OPENSHIFT_MONGODB_DB_HOST + dbName;

console.log(connectionString);

keystone.set('mongo', connectionString);

keystone.init({
    'mongo': connectionString,
    'name': 'node',
    'brand': 'node',

    'sass': 'public',
    'static': 'public',
    'favicon': 'public/favicon.ico',
    'views': 'templates/views',
    'view engine': 'jade',

    'auto update': true,
    'session': true,
    'auth': true,
    'user model': 'User',
    'cookie secret': '^<S0$!?a778,)~[Fx4wQvgcTw]fWq.)<s`cAJc:bExU*(L&ty9;mSV?`am:*7f.P'

});

// Load your project's Models

keystone.import('models');

// Setup common locals for your templates. The following are required for the
// bundled templates and layouts. Any runtime locals (that should be set uniquely
// for each request) should be added to ./routes/middleware.js

keystone.set('locals', {
    _: require('underscore'),
    env: keystone.get('env'),
    utils: keystone.utils,
    editable: keystone.content.editable
});

// Load your project's Routes

keystone.set('routes', require('./routes'));

// Setup common locals for your emails. The following are required by Keystone's
// default email templates, you may remove them if you're using your own.

// Configure the navigation bar in Keystone's Admin UI

keystone.set('nav', {
    'posts': ['posts', 'post-categories'],
    'enquiries': 'enquiries',
    'users': 'users'
});

// Start Keystone to connect to your database and initialise the web server

keystone.start();

1 个答案:

答案 0 :(得分:0)

通过确保所有节点模块都在服务器上,使用sourcetree保持超时推送到repo来修复此问题,因此模块不在那里。我代替他们FTP了。