read API endpoint from HTML

This commit is contained in:
Konstantin Haase 2012-07-23 17:35:36 +02:00
parent df9213a065
commit e7d0426493
3 changed files with 5 additions and 5 deletions

View File

@ -3,10 +3,6 @@ require 'models'
jQuery.support.cors = true jQuery.support.cors = true
@Travis.RestAdapter = DS.RESTAdapter.extend @Travis.RestAdapter = DS.RESTAdapter.extend
# API_DOMAIN: 'http://localhost:9292'
# API_DOMAIN: 'http://travis.local:9292'
API_DOMAIN: ''
DEFAULT_OPTIONS: DEFAULT_OPTIONS:
accepts: accepts:
json: 'application/vnd.travis-ci.2+json' json: 'application/vnd.travis-ci.2+json'
@ -31,4 +27,4 @@ jQuery.support.cors = true
worker: 'workers' worker: 'workers'
ajax: (url, method, options) -> ajax: (url, method, options) ->
@_super("#{@API_DOMAIN}#{url}", method, $.extend(options, @DEFAULT_OPTIONS)) @_super("#{Travis.config.api_endpoint}#{url}", method, $.extend(options, @DEFAULT_OPTIONS))

View File

@ -2,6 +2,9 @@ require 'ext/jquery'
require 'ext/ember/namespace' require 'ext/ember/namespace'
@Travis = Em.Namespace.create @Travis = Em.Namespace.create
config:
api_endpoint: $('meta[name="travis.api_endpoint"]').attr('content')
CONFIG_KEYS: ['rvm', 'gemfile', 'env', 'jdk', 'otp_release', 'php', 'node_js', 'perl', 'python', 'scala'] CONFIG_KEYS: ['rvm', 'gemfile', 'env', 'jdk', 'otp_release', 'php', 'node_js', 'perl', 'python', 'scala']
ROUTES: ROUTES:

View File

@ -2,6 +2,7 @@
<html> <html>
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta name="travis.api_endpoint" content="http://localhost:9292">
<title>Travis CI - Distributed Continuous Integration Platform for the Open Source Community</title> <title>Travis CI - Distributed Continuous Integration Platform for the Open Source Community</title>
<link rel="stylesheet" href="/stylesheets/application.css"> <link rel="stylesheet" href="/stylesheets/application.css">
<script src="/javascripts/vendor.js"></script> <script src="/javascripts/vendor.js"></script>