// Path: web-api/SparkHelloWorld/src/main/java/com/sample/get/GetRequests.java
// public class GetRequests {
// 
//     private static final Logger log = Logger.getLogger(GetRequests.class);
// 
//     /**
//      * Sample get request to print a greeting on the browser
//      */
//     public static void greet() {
//         get("/helloWorld", (arg0, arg1) -> "This is from the Get method. Hello world");
//     }
// 
//     /**
//      * Get request to print the query parameters passed
//      * Sample request can look like <code>http://localhost:4567/helloWorld2?a=1,2&b=a&a=5</code>
//      */
//     public static void getQueryParams() {
//         String result = "";
//         get("/helloWorld2", (req, res) -> {
//             Map<String, String[]> queryParamsMap = req.queryMap().toMap();
//             for (String p : queryParamsMap.keySet()) {
//                 String[] vals = queryParamsMap.get(p);
//                 for (String val : vals) {
//                     log.info(p + "::" + val);
//                 }
// 
//             }
//             return result;
//         });
//     }
// 
//     public static void add() {
//         get("/sumop", (req, res) -> {
//             SumFunctionalI functionalI = (String tokenA, String tokenB) -> tokenA + tokenB;
//             return functionalI.concatStrings("Hello", "World");
//         });
// 
//     }
// 
// }
// 
// Path: web-api/SparkHelloWorld/src/main/java/com/sample/post/PostRequests.java
// public class PostRequests {
// 
//     private static final Logger log = Logger.getLogger(PostRequests.class);
// 
//     /**
//      * Dummy post request
//      */
//     public static void postTest() {
//         post("/post1", (req, res) -> {
//             log.info("Init post ....");
//             return "Getting from post";
//         });
// 
//     }
// 
// }


import com.sample.get.GetRequests;
import com.sample.post.PostRequests;
package com.sample.main;


/**
 * Main runner to deploy the individual services
 *
 * @author saifasif
 */
public class MainRunner {

    public static void main(String[] args) {

        // Deploy the get requests
        GetRequests.greet();
        // Deploy the post requests
// Path: web-api/SparkHelloWorld/src/main/java/com/sample/get/GetRequests.java
// public class GetRequests {
// 
//     private static final Logger log = Logger.getLogger(GetRequests.class);
// 
//     /**
//      * Sample get request to print a greeting on the browser
//      */
//     public static void greet() {
//         get("/helloWorld", (arg0, arg1) -> "This is from the Get method. Hello world");
//     }
// 
//     /**
//      * Get request to print the query parameters passed
//      * Sample request can look like <code>http://localhost:4567/helloWorld2?a=1,2&b=a&a=5</code>
//      */
//     public static void getQueryParams() {
//         String result = "";
//         get("/helloWorld2", (req, res) -> {
//             Map<String, String[]> queryParamsMap = req.queryMap().toMap();
//             for (String p : queryParamsMap.keySet()) {
//                 String[] vals = queryParamsMap.get(p);
//                 for (String val : vals) {
//                     log.info(p + "::" + val);
//                 }
// 
//             }
//             return result;
//         });
//     }
// 
//     public static void add() {
//         get("/sumop", (req, res) -> {
//             SumFunctionalI functionalI = (String tokenA, String tokenB) -> tokenA + tokenB;
//             return functionalI.concatStrings("Hello", "World");
//         });
// 
//     }
// 
// }
// 
// Path: web-api/SparkHelloWorld/src/main/java/com/sample/post/PostRequests.java
// public class PostRequests {
// 
//     private static final Logger log = Logger.getLogger(PostRequests.class);
// 
//     /**
//      * Dummy post request
//      */
//     public static void postTest() {
//         post("/post1", (req, res) -> {
//             log.info("Init post ....");
//             return "Getting from post";
//         });
// 
//     }
// 
// }


// Path: web-api/SparkHelloWorld/src/main/java/com/sample/main/MainRunner.java
import com.sample.get.GetRequests;
import com.sample.post.PostRequests;

package com.sample.main;


/**
 * Main runner to deploy the individual services
 *
 * @author saifasif
 */
public class MainRunner {

    public static void main(String[] args) {

        // Deploy the get requests
        GetRequests.greet();
        // Deploy the post requests
        PostRequests.postTest();