Dynamic domain

This commit is contained in:
Bruno SIMON
2016-06-07 14:17:20 +02:00
parent 6e32b80ddd
commit 1126da2747
10 changed files with 31 additions and 16 deletions
@@ -1 +1,3 @@
var angular_module = angular.module( 'application', [] );
var application = angular.module( 'application', [] );
application.constant( 'config', config );
@@ -1,4 +1,4 @@
angular_module.controller(
application.controller(
'ProjectController',
[
'$scope',
@@ -1,4 +1,4 @@
angular_module.controller(
application.controller(
'ProjectsController',
[
'$scope',
+4 -3
View File
@@ -1,8 +1,9 @@
angular_module.factory(
application.factory(
'project',
[
'config',
'$timeout',
function( $timeout )
function( config, $timeout )
{
var update_callback = null;
@@ -85,7 +86,7 @@ angular_module.factory(
result.connect = function( project_name )
{
// Connect to socket
var socket = io( 'http://192.168.1.4:3000/project/' + project_name );
var socket = io( config.domain + '/project/' + project_name );
// Connect event
socket.on( 'connect', function()
+4 -3
View File
@@ -1,7 +1,8 @@
angular_module.factory(
application.factory(
'projects',
[
function()
'config',
function( config )
{
update_callback = null;
@@ -14,7 +15,7 @@ angular_module.factory(
};
// Socket
var socket = io( 'http://192.168.1.4:3000/projects' );
var socket = io( config.domain + '/projects' );
socket.on( 'update_projects', function( data )
{