Advanced database search using Strongloop
npm install nv-advanced-search --save
server.js
require('nv-advanced-search')(app);
// or
require('nv-advanced-search')(app, '/myAdvancedSearchEndpoint');
This example is for MS SQL loopback connector, you can use different loopback connector.
You should use HTTPS because datasource contains some sensitive data!
{
"ds": {
"server": "ip address or name of your database server",
"port": 1433,
"database": "name of database",
"user": "username of database user",
"password": "password of database user"
},
,
"method": {
"name": "mssql stored procedure name",
"parameters": [{
"name": "foo",
"value": "foo value"
}, {
"name": "bar",
"value": "bar value"
}]
}
}
curl -data "use json above" https://localhost:3100/advanced-search
or
curl -data "use json above" https://localhost:3100/myAdvancedSearchEndpoint
ISC © Nova Vizija d.d.