Commit 3f505dbe authored by Richard Torenvliet's avatar Richard Torenvliet

Update to work with production and development

parent 7d1908fa
import JSONAPIAdapter from 'ember-data/adapters/json-api'; import JSONAPIAdapter from 'ember-data/adapters/json-api';
import ENV from 'viewer/config/environment';
export default JSONAPIAdapter.extend({ export default JSONAPIAdapter.extend({
host: 'http://localhost:8888', host: ENV.APP.APIURL,
namespace: 'api/v1' namespace: 'api/v1'
}); });
import Ember from 'ember'; import Ember from 'ember';
import ENV from 'viewer/config/environment';
const { get, inject } = Ember; const { get, inject } = Ember;
...@@ -19,7 +20,7 @@ export default Ember.Controller.extend({ ...@@ -19,7 +20,7 @@ export default Ember.Controller.extend({
socketRef: null, socketRef: null,
init() { init() {
const socket = get(this, 'websockets').socketFor('ws://localhost:8888/reconstruction'); const socket = get(this, 'websockets').socketFor(ENV.APP.websocketsURL);
socket.on('open', this.openHandler, this); socket.on('open', this.openHandler, this);
socket.on('message', this.messageHandler, this); socket.on('message', this.messageHandler, this);
......
...@@ -7,6 +7,9 @@ module.exports = function(environment) { ...@@ -7,6 +7,9 @@ module.exports = function(environment) {
baseURL: '/', baseURL: '/',
locationType: 'auto', locationType: 'auto',
EmberENV: { EmberENV: {
EXTEND_PROTOTYPES: {
Date: false,
},
FEATURES: { FEATURES: {
// Here you can enable experimental features on an ember canary build // Here you can enable experimental features on an ember canary build
// e.g. 'with-controller': true // e.g. 'with-controller': true
...@@ -20,7 +23,10 @@ module.exports = function(environment) { ...@@ -20,7 +23,10 @@ module.exports = function(environment) {
}; };
if (environment === 'development') { if (environment === 'development') {
ENV.APP.staticURL = 'http://localhost:8888/data/'; ENV.APP.websocketsURL = 'ws://localhost:6930/reconstruction';
ENV.APP.staticURL = 'http://localhost:6930/data/';
ENV.APP.APIURL = 'http://localhost:6930';
// ENV.APP.LOG_RESOLVER = true; // ENV.APP.LOG_RESOLVER = true;
// ENV.APP.LOG_ACTIVE_GENERATION = true; // ENV.APP.LOG_ACTIVE_GENERATION = true;
// ENV.APP.LOG_TRANSITIONS = true; // ENV.APP.LOG_TRANSITIONS = true;
...@@ -41,7 +47,11 @@ module.exports = function(environment) { ...@@ -41,7 +47,11 @@ module.exports = function(environment) {
} }
if (environment === 'production') { if (environment === 'production') {
ENV.APP.websocketsURL = 'wss://richard.kompiler.org/reconstruction';
ENV.APP.staticURL = 'https://richard.kompiler.org/data/';
ENV.APP.APIURL = 'https://richard.kompiler.org';
ENV.baseURL = '/face-reconstruction/';
ENV.rootURL = '/face-reconstruction/';
} }
return ENV; return ENV;
......
...@@ -4,21 +4,30 @@ var EmberApp = require('ember-cli/lib/broccoli/ember-app'); ...@@ -4,21 +4,30 @@ var EmberApp = require('ember-cli/lib/broccoli/ember-app');
module.exports = function(defaults) { module.exports = function(defaults) {
var app = new EmberApp(defaults, { var app = new EmberApp(defaults, {
// Add options here sourcemaps: { enabled: true, extensions: ['js']},
minifyJS: {
enabled: false
},
minifyCSS: {
enabled: false
},
fingerprint: {
enabled: true
}
}); });
// bower compoenents // bower compoenents
app.import('bower_components/basscss/modules/align/index.css'); //app.import('bower_components/basscss/modules/align/index.css');
app.import('bower_components/basscss/modules/border/index.css'); //app.import('bower_components/basscss/modules/border/index.css');
app.import('bower_components/basscss/modules/flexbox/index.css'); //app.import('bower_components/basscss/modules/flexbox/index.css');
app.import('bower_components/basscss/modules/grid/index.css'); //app.import('bower_components/basscss/modules/grid/index.css');
app.import('bower_components/basscss/modules/hide/index.css'); //app.import('bower_components/basscss/modules/hide/index.css');
app.import('bower_components/basscss/modules/layout/index.css'); //app.import('bower_components/basscss/modules/layout/index.css');
app.import('bower_components/basscss/modules/margin/index.css'); //app.import('bower_components/basscss/modules/margin/index.css');
app.import('bower_components/basscss/modules/padding/index.css'); //app.import('bower_components/basscss/modules/padding/index.css');
app.import('bower_components/basscss/modules/position/index.css'); //app.import('bower_components/basscss/modules/position/index.css');
app.import('bower_components/basscss/modules/type-scale/index.css'); //app.import('bower_components/basscss/modules/type-scale/index.css');
app.import('bower_components/basscss/modules/typography/index.css'); //app.import('bower_components/basscss/modules/typography/index.css');
// npm modules // npm modules
//app.import('node_modules/basscss-responsive-margin/css/responsive-margin.css'); //app.import('node_modules/basscss-responsive-margin/css/responsive-margin.css');
......
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
"devDependencies": { "devDependencies": {
"basscss-responsive-margin": "^1.1.0", "basscss-responsive-margin": "^1.1.0",
"broccoli-asset-rev": "^2.4.2", "broccoli-asset-rev": "^2.4.2",
"dat-gui": "^0.5.0",
"ember-ajax": "^2.0.1", "ember-ajax": "^2.0.1",
"ember-browserify": "1.1.10", "ember-browserify": "1.1.10",
"ember-cli": "2.6.2", "ember-cli": "2.6.2",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment