/* GET CUSTOMER ADDRESS CORRESPONDING to a restaurantID and customerID */ $app->get('/merchant/:id/customeradd/:id2', function ($id, $id2) use($app) { // check for required params $request = array(); $response = array(); $apiKey = array(); $headers = $app->request->headers->all(); verifyHeaders(array('Key')); // reading request params $apiKey = $headers['Key']; $request['apiKey'] = $apiKey; $request['restaurantID'] = $id; $request["customerID"] = $id2; $controller = new CustomerController(); // Call controller function $response = $controller->getAddress($request); // echo json response echoRespnse(200, $response); }); // POST : INSERT CUSTOMER DETAILS $app->post('/merchant/:id/customer', function ($id) use($app) { // check for required params $request = array(); $response = array(); $apiKey = array(); $dataJSON = array(); $headers = $app->request->headers->all(); verifyHeaders(array('Key')); // reading request params $apiKey = $headers['Key']; // echo json_encode($headers);