1
0
Fork 0
mirror of https://git.rwth-aachen.de/acs/public/villas/web/ synced 2025-03-16 00:00:03 +01:00
VILLASweb/app/mirage/config.js

39 lines
721 B
JavaScript
Raw Normal View History

export default function() {
this.namespace = '/api/ngsi10';
this.post('/queryContext', function(db, request) {
2015-09-28 13:45:09 +02:00
return {
contextResponses: db.entities.map(attrs => ({
contextElement: {
type: attrs.type,
isPattern: false,
id: attrs.name,
attributes: attrs.properties.map(props => ({
name: props.name,
type: props.type,
value: props.value,
metadatas: [
{
name: 'timestamp',
type: 'date',
value: props.timestamp
}
]
}))
},
statusCode: {
code: 200,
reasonPhrase: 'OK'
}
}))
};
2015-09-28 13:45:09 +02:00
});
}
/*
You can optionally export a config that is only loaded during tests
export function testConfig() {
}
*/