package io.logspace.hq.webapp.resource;

import javax.annotation.PostConstruct;
import javax.inject.Named;

import com.indoqa.spark.AbstractResourcesBase;

@Named
public class EventResource extends AbstractResourcesBase {

    @PostConstruct
    public void mount() {
        this.postAsJson("/events", (req, res) -> "foo");
    }
}

@@ -101,16 +101,140 @@
 Named;%0A%0A
+import org.slf4j.Logger;%0Aimport org.slf4j.LoggerFactory;%0A%0Aimport spark.Request;%0Aimport spark.Response;%0Aimport spark.Spark;%0A%0A
 import c
@@ -340,16 +340,93 @@
 Base %7B%0A%0A
+    private final Logger logger = LoggerFactory.getLogger(this.getClass());%0A%0A
     @Pos
@@ -474,23 +474,18 @@
     
-this.postAsJson
+Spark.post
 (%22/e
@@ -510,14 +510,180 @@
  -%3E 
-%22foo%22)
+this.logEvents(req, res));%0A    %7D%0A%0A    private String logEvents(Request req, Response res) %7B%0A        this.logger.info(req.body());%0A        res.status(202);%0A        return %22%22
 ;%0A  

use logging to write received events