How to use the ghost/core/server/config.set function in ghost

To help you get started, we’ve selected a few ghost examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github gazooka / GhostInAzureWebApp / server.js View on Github external
if (s[fn]) {
			return s[fn];
		};
	}
	return originalReadFileSync(file, options);
};

// replace standard readFileSync with our caching version
fs.readFileSync = cachedReadFileSync;

// if iisnode is being used, it defines the port we need to use in an environment
// variable; if this variable is defined, we override the config with it otherwise
// the web app won't work correctly
if (process.env.PORT) {
	// we do the require in-place here to ensure it comes from the cache
	require('ghost/core/server/config').set('server:port', process.env.PORT);
}

// on Windows, Ctrl-C (SIGINT) won't be recognised unless we go via readline
if (process.platform === 'win32') {
	var rl = require('readline').createInterface({
		input: process.stdin,
		output: process.stdout
	});

	rl.on('SIGINT', function () {
		process.emit('SIGINT');
	});
}

//
// content of ghost\index.js
github gazooka / GhostInAzureWebApp / server.template.js View on Github external
if (s[fn]) {
			return s[fn];
		};
	}
	return originalReadFileSync(file, options);
};

// replace standard readFileSync with our caching version
fs.readFileSync = cachedReadFileSync;

// if iisnode is being used, it defines the port we need to use in an environment
// variable; if this variable is defined, we override the config with it otherwise
// the web app won't work correctly
if (process.env.PORT) {
	// we do the require in-place here to ensure it comes from the cache
	require('ghost/core/server/config').set('server:port', process.env.PORT);
}

// on Windows, Ctrl-C (SIGINT) won't be recognised unless we go via readline
if (process.platform === 'win32') {
	var rl = require('readline').createInterface({
		input: process.stdin,
		output: process.stdout
	});

	rl.on('SIGINT', function () {
		process.emit('SIGINT');
	});
}