After deploying the node.js application, the ghost blog section is broken

I have a node.js application where one of the views is the ghost.js blog, which I integrated following the wiki wiki article Using Ghost as an npm module .

Currently my local version is working fine.

Error:

When I visit the expanded website, everything works fine, except when I get to mysite.heroku.com/blog , after which I get a ghost page that looks like Ghost 404 Error Page .

I noticed that the application has two localhost branches that work simultaneously ( localhost:3000 and localhost:2368/ ). I am not sure if this could cause an error. I checked Heroku logs and they do not provide more details than the GET request was sent to /blog , returning a 301 first and then 404 error.

It would also be useful to know that when I click the Go to front page link, it sends me to http://localhost:2368/

My config.js file is as follows:

 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 `net.Server#listen()` host: '127.0.0.1', // Port to be passed to node `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, Eg 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 `net.Server#listen()` host: '127.0.0.1', // Port to be passed to node `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; 
+5
source share
1 answer

It looks like Ghost is configured through the config.js file (see the link provided by you), and you can configure it for url: 'http://localhost:2368/blog' . It looks like you need to change this to your actual URL.

Also see this https://github.com/cobyism/ghost-on-heroku

+2
source

All Articles