Avoid error if package ip is not installed

This commit is contained in:
Thomas FORGIONE 2015-10-13 16:38:40 +02:00
parent 5226938ba3
commit f9deb5ff9f
1 changed files with 1 additions and 2 deletions

View File

@ -2,7 +2,6 @@ var http = require('http');
var express = require('express'); var express = require('express');
var jade = require('jade'); var jade = require('jade');
var pg = require('pg'); var pg = require('pg');
var ip = require('ip');
var favicon = require('serve-favicon'); var favicon = require('serve-favicon');
@ -105,7 +104,7 @@ app.use(function(req, res) {
var serverPort, serverIpAddress; var serverPort, serverIpAddress;
if ( isDev ) { if ( isDev ) {
serverPort = 4000; serverPort = 4000;
serverIpAddress = ip.address(); serverIpAddress = require('ip').address();
} else { } else {
// Openhift conf // Openhift conf
serverPort = process.env.OPENSHIFT_NODEJS_PORT || 8080; serverPort = process.env.OPENSHIFT_NODEJS_PORT || 8080;