Is there any way to do if else in route ?
Here is what I am looking for.
I want to write an route API such that it will take an keyword as input and depending on the keyword it will return the contents from a particular table.
---- Route script ----
wsapis = [
{"wskey": "ws1", "wstable": "satish_ws1"},
{"wskey": "ws3", "wstable": "satish_ws3"}
];
wstable1 = select wstable from wsapis where
wskey = '{keyword}';
return select * from wstable1
via route '/wsapi' using method get;
---- Create table scripts ----
create table satish_ws1
on select get from "http://10.77.36.49:8080/RESTFull/services/hello/hello1";
create table satish_ws3
on select get from "http://10.77.36.49:8080/RESTFull/services/hello/hello3";
=============================================================================================
This is to create a common interface to get data from different sites. So the application logic will be same for different sites.
Note: I saw a similar topic on this forum but without solution :(
create table satish_ws
on select get from "{user_url}";