-
-
Save tubia/b65a8cd1105483725ae9 to your computer and use it in GitHub Desktop.
Ember-cli not rendering API
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* jshint node: true */ | |
module.exports = function(environment) { | |
var ENV = { | |
modulePrefix: 'ember-test', | |
environment: environment, | |
baseURL: '/ember-test/dist/', | |
locationType: 'auto', | |
EmberENV: { | |
FEATURES: { | |
// Here you can enable experimental features on an ember canary build | |
// e.g. 'with-controller': true | |
} | |
}, | |
APP: { | |
// Here you can pass flags/options to your application instance | |
// when it is created | |
}, | |
sassOptions: { | |
includePaths: ['bower_components/materialize/sass'] | |
} | |
}; | |
if (environment === 'development') { | |
// ENV.APP.LOG_RESOLVER = true; | |
// ENV.APP.LOG_ACTIVE_GENERATION = true; | |
// ENV.APP.LOG_TRANSITIONS = true; | |
// ENV.APP.LOG_TRANSITIONS_INTERNAL = true; | |
// ENV.APP.LOG_VIEW_LOOKUPS = true; | |
ENV.contentSecurityPolicy = { | |
'connect-src': "'self' https://api.github.com/*", | |
'style-src': "'self' http://localhost:4200/*", | |
}; | |
} | |
if (environment === 'test') { | |
// Testem prefers this... | |
ENV.baseURL = '/'; | |
ENV.locationType = 'none'; | |
// keep test console output quieter | |
ENV.APP.LOG_ACTIVE_GENERATION = false; | |
ENV.APP.LOG_VIEW_LOOKUPS = false; | |
ENV.APP.rootElement = '#ember-testing'; | |
} | |
if (environment === 'production') { | |
ENV.contentSecurityPolicy = { | |
'connect-src': "'self' https://api.github.com/*" | |
}; | |
} | |
return ENV; | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
import config from './config/environment'; | |
var Router = Ember.Router.extend({ | |
location: config.locationType | |
}); | |
Router.map(function() { | |
this.route('user', { path: '/users/:username'}); | |
}); | |
export default Router; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
export default Ember.Route.extend({ | |
model: function(params){ | |
return Ember.$.getJSON('https://api.github.com/users/' + params.username); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment