mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-20 22:42:53 -05:00
Blog URL per environment
closes #572 - Moved the siteUrl setting into each individual env config. - Updated app start and RSS to use the new config
This commit is contained in:
parent
4d4d4ac0e6
commit
13646f9ef6
3 changed files with 25 additions and 18 deletions
33
config.js
33
config.js
|
@ -18,9 +18,6 @@ config.activePlugins = [
|
|||
'FancyFirstChar'
|
||||
];
|
||||
|
||||
// The url to use when providing links to the site; like RSS and email.
|
||||
config.siteUrl = 'http://127.0.0.1';
|
||||
|
||||
// ## Default Navigation Items
|
||||
// Add new objects here to extend the menu output by {{nav}}
|
||||
config.nav = [
|
||||
|
@ -43,10 +40,12 @@ config.env = {
|
|||
filename: path.join(__dirname, '/core/server/data/ghost-test.db')
|
||||
}
|
||||
},
|
||||
url: {
|
||||
server: {
|
||||
host: '127.0.0.1',
|
||||
port: '2369'
|
||||
}
|
||||
},
|
||||
// The url to use when providing links to the site; like RSS and email.
|
||||
url: 'http://127.0.0.1:2369'
|
||||
},
|
||||
|
||||
travis: {
|
||||
|
@ -56,10 +55,12 @@ config.env = {
|
|||
filename: path.join(__dirname, '/core/server/data/ghost-travis.db')
|
||||
}
|
||||
},
|
||||
url: {
|
||||
server: {
|
||||
host: '127.0.0.1',
|
||||
port: '2368'
|
||||
}
|
||||
},
|
||||
// The url to use when providing links to the site; like RSS and email.
|
||||
url: 'http://127.0.0.1:2368'
|
||||
},
|
||||
|
||||
// Default configuration
|
||||
|
@ -71,10 +72,12 @@ config.env = {
|
|||
},
|
||||
debug: false
|
||||
},
|
||||
url: {
|
||||
server: {
|
||||
host: '127.0.0.1',
|
||||
port: '2368'
|
||||
}
|
||||
},
|
||||
// The url to use when providing links to the site; like RSS and email.
|
||||
url: 'http://127.0.0.1:2368'
|
||||
},
|
||||
|
||||
staging: {
|
||||
|
@ -85,10 +88,12 @@ config.env = {
|
|||
},
|
||||
debug: false
|
||||
},
|
||||
url: {
|
||||
server: {
|
||||
host: '127.0.0.1',
|
||||
port: '2368'
|
||||
}
|
||||
},
|
||||
// The url to use when providing links to the site; like RSS and email.
|
||||
url: 'http://127.0.0.1:2368'
|
||||
},
|
||||
|
||||
production: {
|
||||
|
@ -99,10 +104,12 @@ config.env = {
|
|||
},
|
||||
debug: false
|
||||
},
|
||||
url: {
|
||||
server: {
|
||||
host: '127.0.0.1',
|
||||
port: '2368'
|
||||
}
|
||||
},
|
||||
// The url to use when providing links to the site; like RSS and email.
|
||||
url: 'http://127.0.0.1:2368'
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -50,7 +50,7 @@ frontendControllers = {
|
|||
},
|
||||
'rss': function (req, res) {
|
||||
// Initialize RSS
|
||||
var siteUrl = ghost.config().siteUrl,
|
||||
var siteUrl = ghost.config().env[process.env.NODE_ENV].url,
|
||||
feed = new RSS({
|
||||
title: ghost.settings().title,
|
||||
description: ghost.settings().description,
|
||||
|
|
8
index.js
8
index.js
|
@ -251,8 +251,8 @@ when.all([ghost.init(), filters.loadCoreFilters(ghost), helpers.loadCoreHelpers(
|
|||
|
||||
// ## Start Ghost App
|
||||
ghost.app().listen(
|
||||
ghost.config().env[process.env.NODE_ENV || 'development'].url.port,
|
||||
ghost.config().env[process.env.NODE_ENV || 'development'].url.host,
|
||||
ghost.config().env[process.env.NODE_ENV].server.port,
|
||||
ghost.config().env[process.env.NODE_ENV].server.host,
|
||||
function () {
|
||||
|
||||
// Tell users if their node version is not supported, and exit
|
||||
|
@ -277,8 +277,8 @@ when.all([ghost.init(), filters.loadCoreFilters(ghost), helpers.loadCoreHelpers(
|
|||
|
||||
// Startup message
|
||||
console.log("Express server listening on address:",
|
||||
ghost.config().env[process.env.NODE_ENV || 'development'].url.host + ':'
|
||||
+ ghost.config().env[process.env.NODE_ENV || 'development'].url.port);
|
||||
ghost.config().env[process.env.NODE_ENV].server.host + ':'
|
||||
+ ghost.config().env[process.env.NODE_ENV].server.port);
|
||||
|
||||
// Let everyone know we have finished loading
|
||||
loading.resolve();
|
||||
|
|
Loading…
Add table
Reference in a new issue