После развертывания приложения node.js раздел блога-призрака разрывается
У меня есть приложение node.js, где одним из представлений является ghost.js
блог, который я интегрировал, следуя вики-статье Ghost "Использование Ghost в качестве модуля npm".
В настоящее время моя локальная версия работает отлично.
Ошибка:
Когда я захожу на развернутый сайт, все работает нормально, кроме случаев, когда я mysite.heroku.com/blog
в этот момент я получаю страницу призрака в виде ,
Я заметил, что приложение имеет две ветви localhost, работающие одновременно (localhost:3000
а также localhost:2368/
). Я не уверен, может ли это быть причиной ошибки. Я проверил мой Heroku
журналы, и они не предоставляют более подробной информации, чем это GET
запрос был отправлен /blog
, вернувшись сначала 301
а затем 404
ошибка.
Кроме того, было бы полезно знать, что когда я нажимаю на Go to front page
ссылка отправляет меня http://localhost:2368/
Мой файл config.js выглядит следующим образом:
var path = require('path'),
config;
config = {
// ### Production
// When running Ghost in the wild, use the production environment
// Configure your URL and mail settings here
production: {
url: 'http://example.com/blog',
mail: {},
database: {
client: 'sqlite3',
connection: {
filename: path.join(__dirname, '/content/data/ghost.db')
},
debug: false
},
server: {
// Host to be passed to node's `net.Server#listen()`
host: '127.0.0.1',
// Port to be passed to node's `net.Server#listen()`, for iisnode set this to `process.env.PORT`
port: '2368'
}
},
// ### Development **(default)**
development: {
// The url to use when providing links to the site, E.g. in RSS and email.
// Change this to your Ghost blogs published URL.
url: 'http://localhost:2368/blog',
// Example mail config
// Visit http://support.ghost.org/mail for instructions
// ```
// mail: {
// transport: 'SMTP',
// options: {
// service: 'Mailgun',
// auth: {
// user: '', // mailgun username
// pass: '' // mailgun password
// }
// }
// },
// ```
database: {
client: 'sqlite3',
connection: {
filename: path.join(__dirname, '/content/data/ghost-dev.db')
},
debug: false
},
server: {
// Host to be passed to node's `net.Server#listen()`
host: '127.0.0.1',
// Port to be passed to node's `net.Server#listen()`, for iisnode set this to `process.env.PORT`
port: '2368'
},
paths: {
contentPath: path.join(__dirname, '/content/')
}
},
// **Developers only need to edit below here**
// ### Testing
// Used when developing Ghost to run tests and check the health of Ghost
// Uses a different port number
testing: {
url: 'http://127.0.0.1:2369',
database: {
client: 'sqlite3',
connection: {
filename: path.join(__dirname, '/content/data/ghost-test.db')
}
},
server: {
host: '127.0.0.1',
port: '2369'
},
logging: false
},
// ### Testing MySQL
// Used by Travis - Automated testing run through GitHub
'testing-mysql': {
url: 'http://127.0.0.1:2369',
database: {
client: 'mysql',
connection: {
host : '127.0.0.1',
user : 'root',
password : '',
database : 'ghost_testing',
charset : 'utf8'
}
},
server: {
host: '127.0.0.1',
port: '2369'
},
logging: false
},
// ### Testing pg
// Used by Travis - Automated testing run through GitHub
'testing-pg': {
url: 'http://127.0.0.1:2369',
database: {
client: 'pg',
connection: {
host : '127.0.0.1',
user : 'postgres',
password : '',
database : 'ghost_testing',
charset : 'utf8'
}
},
server: {
host: '127.0.0.1',
port: '2369'
},
logging: false
}
};
// Export config
module.exports = config;
1 ответ
Похоже, Ghost настроен через config.js
файл (см. ссылку, которую вы предоставили), и что вы можете настроить его для url: 'http://localhost:2368/blog'
, Похоже, вам нужно изменить это на ваш фактический URL.
Также смотрите этот https://github.com/cobyism/ghost-on-heroku