WIP: proxy
authorKai Moritz <kai@juplo.de>
Thu, 16 Jun 2016 11:56:55 +0000 (13:56 +0200)
committerKai Moritz <kai@juplo.de>
Thu, 16 Jun 2016 11:56:55 +0000 (13:56 +0200)
src/main/java/de/juplo/thymeproxy/Application.java
src/main/java/de/juplo/thymeproxy/ProxyHttpRequestHandler.java
src/main/resources/application.properties

index a12205e..66557b9 100644 (file)
@@ -1,6 +1,7 @@
 package de.juplo.thymeproxy;
 
-import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
 import org.apache.http.impl.client.CloseableHttpClient;
 import org.springframework.boot.SpringApplication;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
@@ -19,7 +20,13 @@ public class Application
   {
     RegexUrlHandlerMapping mapping = new RegexUrlHandlerMapping();
     mapping.setOrder(Ordered.HIGHEST_PRECEDENCE);
-    mapping.setUrlMap(Collections.singletonMap(".*\\.html$", handler));
+    Map<String, Object> mappings = new HashMap<>();
+    mappings.put(".*\\.html$", handler);
+    mappings.put("/css/.+", handler);
+    mappings.put("/js/.+", handler);
+    mappings.put("/fonts/.+", handler);
+    mappings.put("/.+/", handler);
+    mapping.setUrlMap(mappings);
        return mapping;
   }
 
index 41c3bdd..2ea7762 100644 (file)
@@ -102,7 +102,6 @@ public class ProxyHttpRequestHandler
     }
 
     String resource = builder.toString();
-    LOG.debug("requesting: {}", resource);
 
     CloseableHttpResponse p_response = null;
     try
@@ -113,7 +112,7 @@ public class ProxyHttpRequestHandler
 
       StatusLine status = p_response.getStatusLine();
       int code = status.getStatusCode();
-      LOG.debug("response: {} - {}", code, status.getReasonPhrase());
+      LOG.info("{} - {}: {}", code, status.getReasonPhrase(), resource);
 
       setCacheControl(computeCacheControl(p_response));
       prepareResponse(response);
index 496184b..0a4144f 100644 (file)
@@ -4,6 +4,6 @@ server.port=@thymeproxy.port@
 thymeproxy.ttl=@thymeproxy.ttl@
 thymeproxy.origins[0].uri=http://localhost:8080/thymeleaf/
 
-logging.level.de.juplo=trace
+logging.level.de.juplo=info
 logging.level.org.apache.http=@httpclient.logging.level@
 logging.level.org.apache.http.wire=ERROR