--- a/src/main/scala/Main.scala Mon Aug 22 14:29:53 2011 -0400
+++ b/src/main/scala/Main.scala Mon Aug 22 15:04:55 2011 -0400
@@ -15,13 +15,8 @@
val logger:Logger = LoggerFactory.getLogger(this.getClass)
def main(args: Array[String]) {
-
- val log = {
- println("toto")
- unfiltered.filter.Planify {
- case Path(Seg(p :: Nil)) => ResponseString(p)
- }
- }
+
+ val port = args.toList.headOption map { _.toInt } getOrElse 2719
val echo = unfiltered.filter.Planify {
case Path(Seg(p :: Nil)) => ResponseString(p)
@@ -29,12 +24,17 @@
val app = unfiltered.filter.Planify {
case req @ Path(Seg("tracker" :: Nil)) => Ok ~> ContentType("application/xhtml+xml") ~> Scalate(req, "geolocation.ssp")
+ case req @ POST(Path(Seg("user" :: user :: "run" :: Nil))) => {
+ val body = Body.string(req)
+ logger.info(body)
+ ResponseString(body)
+ }
}
import javax.servlet._
import javax.servlet.http._
- unfiltered.jetty.Http(2719).filter {
+ unfiltered.jetty.Http(port).filter {
new Filter {
def destroy():Unit = ()
def doFilter(request:ServletRequest, response:ServletResponse, chain:FilterChain):Unit = {