I am using ngRest on my Rasberry PI 3 Model B
I have nginx version 1.14.2
After making necessary changes to /etc/nginx/nginx.conf and /etc/nginx/sites-enabled/default
My ngRest service has 2 end points
1. /service/{text}
2. /service/query?command={command}
On standalone ngrest server both the end-points work fine.
In /etc/nginx/sites-enabled/default, I have the following configured
location /ngrest/service/ {
}
location /service/ {
ngrest /home/pi/Projects/C-Projects/ngRest/Service/.ngrest/local/build/deploy/share/ngrest/services;
}
The REST end-point, /service/query?command={command}, works fine on ngrest and also when using the nginx with /ngrest/service/query?command=CMD1
But it fails with ngrest module, i.e. when using /service/query?command=CMD1
However it works with /service/{CMD1}.
Has it got something to do with Unicode string or any other conversion.
Below is the signature of the service
//! Send command to inverter and returns its response
// *method: GET
// *location: /query/{command}
std::string query(const std::string& command);
I am using a third party library, simpleio, to communicate with a serial port, which accepts char* , hence I am using the std::string::c_str() to convert std::string to char *.
Can someone, please help me with some pointers, on why it would not work with ngRest nginx module.
Thank you
Best Regards
Phani