mirror of
https://git.rwth-aachen.de/acs/public/villas/web/
synced 2025-03-16 00:00:03 +01:00

Mirage mockup is used in development environment. Adapter's host port need to be changed for production environment.
38 lines
721 B
JavaScript
38 lines
721 B
JavaScript
export default function() {
|
|
this.namespace = '/api/ngsi10';
|
|
|
|
this.post('/queryContext', function(db, request) {
|
|
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'
|
|
}
|
|
}))
|
|
};
|
|
});
|
|
}
|
|
|
|
/*
|
|
You can optionally export a config that is only loaded during tests
|
|
export function testConfig() {
|
|
|
|
}
|
|
*/
|