package com.example;


import java.io.File;
import java.io.IOException;

import org.apache.commons.io.FileUtils;

import com.jhttpserver.core.WebServer;
import com.jhttpserver.entity.Request;
import com.jhttpserver.entity.Response;
import com.jhttpserver.interfaces.Execution;

public class App {
	public static void main(String[] args) {
		WebServer server = new WebServer();
		
		server.post("/post", new Execution() {
			
			@Override
			public void onExecute(Request req, Response res) {
				 res.send(req.toString());
			}
		});
		server.get("/", new Execution() {
			
			@Override
			public void onExecute(Request req, Response res) {
				try {
					res.send(FileUtils.readFileToString(new File("./layouts/index.html")));
				} catch (IOException e) {
					e.printStackTrace();
				}
				
			}
		});

		server.get("/hello", new Execution() {

			@Override
			public void onExecute(Request req, Response res) {
				res.send("hello JHttpServer");
			}
		});

		server.get("/like", new Execution() {

			@Override
			public void onExecute(Request req, Response res) {
				res.send("Do you like JHttpServer?");
			}
		});
		//DefaultPort = 8000
		server.listen(WebServer.DefaultPort);
	}
}

@@ -15,17 +15,16 @@
 ample;%0A%0A
-%0A
 import j
@@ -373,164 +373,8 @@
 ();%0A
-%09%09%0A%09%09server.post(%22/post%22, new Execution() %7B%0A%09%09%09%0A%09%09%09@Override%0A%09%09%09public void onExecute(Request req, Response res) %7B%0A%09%09%09%09 res.send(req.toString());%0A%09%09%09%7D%0A%09%09%7D);
 %0A%09%09s
@@ -406,19 +406,16 @@
 ion() %7B%0A
-%09%09%09
 %0A%09%09%09@Ove
@@ -534,16 +534,24 @@
 ew File(
+%0A%09%09%09%09%09%09%09
 %22./layou
@@ -631,20 +631,166 @@
 ;%0A%09%09%09%09%7D%0A
+%0A
 %09%09%09
-%09
+%7D%0A%09%09%7D);%0A%0A%09%09server.post(%22/post%22, new Execution() %7B%0A%0A%09%09%09@Override%0A%09%09%09public void onExecute(Request req, Response res) %7B%0A%09%09%09%09res.send(req.getBody());
 %0A%09%09%09%7D%0A%09%09
@@ -1115,16 +1115,17 @@
 %7D);%0A%09%09//
+ 
 DefaultP

add example