Navigation Menu

Skip to content

Commit

Permalink
Use xip.io automatically
Browse files Browse the repository at this point in the history
  • Loading branch information
piroor committed Aug 22, 2012
1 parent 925eb14 commit d3473a0
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions public/javascripts/gcs.js
Expand Up @@ -40,8 +40,12 @@ function renderRequestInformation(data) {
function searchExecute() {
var query = $('form#search input[name="query"]').val();
var domain = $('form#domain input[name="domain-name"]').val();
var host = location.host;
var searchEndpoint = 'http://search-' + domain + '-00000000000000000000000000.' + host + '/2011-02-01/search';
var hostAndPort = location.host.split(':');
if (hostAndPort[0] == 'localhost')
hostAndPort[0] = '127.0.0.1';
if (hostAndPort[0].match(/^\d+\.\d+\.\d+\.\d+$/))
hostAndPort[0] += '.xip.io';
var searchEndpoint = 'http://search-' + domain + '-00000000000000000000000000.' + hostAndPort + '/2011-02-01/search';
var perPage = 5;
var start = parseInt($('form#search input[name="start"]').val() || '0', 10);
var params = {q: query, size: perPage, start: start};
Expand Down

0 comments on commit d3473a0

Please sign in to comment.