1
0
Fork 0
mirror of https://git.rwth-aachen.de/acs/public/villas/web/ synced 2025-03-30 00:00:13 +01:00
VILLASweb/app/adapters/application.js
Markus Grigull 05b404404d Add context broker mockup with mirage
Mirage mockup is used in development environment. Adapter's host port
need to be changed for production environment.
2015-10-07 11:31:02 +02:00

37 lines
853 B
JavaScript

import DS from 'ember-data';
export default DS.RESTAdapter.extend({
host: 'http://localhost:4200',
namespace: 'api/ngsi10',
headers: {
Accept: 'application/json'
},
findAll: function(store, type, sinceToken) {
var requestBody = {
entities: [
{
type: 'ElectricalGridMonitoring',
isPattern: true,
id: 'S?_ElectricalGrid'
}
]
};
return this.ajax(this.host + '/' + this.namespace + '/queryContext', 'POST', { data: requestBody });
},
findRecord: function(store, type, id, snapshot) {
var requestBody = {
entities: [
{
type: 'ElectricalGridMonitoring',
isPattern: false,
id: id
}
]
};
return this.ajax(this.host + '/' + this.namespace + '/queryContext', 'POST', { data: requestBody });
},
});