Deployed ngrest under nginx. I have create two services(add,get)
~$ ls restapi/
add CMakeLists.txt get
copied the lib to following location
--------------------------------
santhosh@santhosh-Lenovo-U310:~$ ls -l /opt/ngrest/services/
total 652
-rwxr-xr-x 1 root root 310344 Oct 13 11:30 add.so
-rwxr-xr-x 1 root root 353232 Oct 13 11:30 get.so
And added location in site-enabled config
--------------------------------
location ~ /(ngrest|restapi|get|getAll) {
ngrest /opt/ngrest/services;
}
location ~ /(ngrest|restapi|add|addRecord) {
ngrest /opt/ngrest/services;
}
loaded ngrest module and added included site-enabled in nginx.conf
--------------------------------
load_module /home/santhosh/.ngrest/ngrest-build/deploy/share/ngrest/modules/nginx/mod_ngrest.so;
include /etc/nginx/sites-enabled/*;
Able to do get service from browser
http://localhost/get/getAll{
"result": [
{
"empId": 200,
"empName": "jai",
"empOrg": "aticara"
},
{
"empId": 100,
"empName": "madhu",
"empOrg": "isoke"
},
{
"empId": 400,
"empName": "mohan",
"empOrg": "isoke"
},
{
"empId": 300,
"empName": "santhosh",
"empOrg": "aticara“ "
}
],
}
Similarly not able to do for add(POST) service
http://localhost/add/addRecord?id=123&name=skumar&org=aticaragetting below error from browser.
The requested URL can't be reached
in ngrest log
------------------------------------------
santhosh-Lenovo-U310:/tmp$ tail -f ngrest_3381.log
D/14-10-2017 10:54:05.824 ServiceDispatcher.cpp:473 dispatchMessage: inside else lastNamedNode
D/14-10-2017 10:54:05.824 ServiceDispatcher.cpp:509 dispatchMessage: inside if engine runphase
D/14-10-2017 10:54:05.824 ServiceDispatcher.cpp:513 dispatchMessage: Invoking service operation 2--get/getAll
D/14-10-2017 10:54:05.824 ServiceDispatcher.cpp:517 dispatchMessage: inside invoke
D/14-10-2017 10:54:05.824 get.cpp:9 getAll: Entered get::getAll method
D/14-10-2017 10:54:06.466 get.cpp:106 getAll: Ended get::getAll method
D/14-10-2017 10:54:19.999 ServiceDispatcher.cpp:360 dispatchMessage: Dispatching message /add/addRecord?id=123&name=skumar&org=aticara
D/14-10-2017 10:54:19.999 ServiceDispatcher.cpp:372 dispatchMessage: Santhosh: method - 1 1
D/14-10-2017 10:54:19.999 ServiceDispatcher.cpp:399 dispatchMessage: Santhosh: inside paramResource base path size 0
D/14-10-2017 10:54:19.999 ServiceDispatcher.cpp:402 dispatchMessage: inside inner if paramResource : 2
For reference i have added my source code. please advice how to resolve this.
Thanks,