@balderdash/sails-edge
Version:
API-driven framework for building realtime apps, using MVC conventions (based on Express and Socket.io)
15 lines (12 loc) • 396 B
JavaScript
/**
* Sails.prototype.getHost()
*
* @return {String} the configured hostname of the server
* (IMPORTANT: returns undefined if not specifically configured)
*/
module.exports = function getHost() {
var sails = this;
var hasExplicitHost = sails.config.hooks.http && sails.config.explicitHost;
var host = sails.config.proxyHost || hasExplicitHost || sails.config.host;
return host;
};