For my POC, created simple lambda function , which will give emp information through rest api. Created lambda function and access all the emp data using API gateway. Facing some challenges while accessing particular data.
i am looking for
emp/1 - to retrieve emp id emp/_search?name="apple" - search name contains apple.
Question is how to retrieve path and request parameters in java code.
public class TestAwsLambdaFunction implements RequestHandler<Map<String, Object>, String> {
@Override
public String handleRequest(Map<String, Object> input, Context context) {
String empID= null;
try {
@SuppressWarnings("unchecked")
Map<String, String> pathParameters = (Map<String, String>) input.get("querystring");
empID= pathParameters.get("id");
System.out.println(empID);
// TO-Do Business logic -
} catch (Exception e) {
// TODO: handle exception
}
return "Hello from Lambda!" + empID;
}
}
What is the best way to expose my data in Rest api call. Bit confused with Lambda or serverless . have any option to show the data via page wise. Since i am new to AWS. Please guide me