Commits

Hector Miuler Malpica Gallegos committed f2897df

demo

Comments (0)

Files changed (3)

+target
+\.idea
+name := "miuler-demo-spray.io"
+
+version := "1.0"
+
+scalaVersion := "2.10.3"
+
+resolvers += "spray repo" at "http://repo.spray.io"
+
+//resolvers += "spray nightlies repo" at "http://nightlies.spray.io"
+
+
+libraryDependencies += "io.spray" % "spray-routing" % "1.2-RC4"
+
+libraryDependencies += "io.spray" % "spray-can" % "1.2-RC4"
+
+
+libraryDependencies += "com.typesafe.akka" %% "akka-actor" % "2.2.3"
+            
+

src/main/scala/miuler/demo/spray/HttpServer.scala

+package miuler.demo.spray
+
+import scala.concurrent.duration._
+import akka.actor.ActorSystem
+import spray.routing.SimpleRoutingApp
+import spray.http._
+import MediaTypes._
+
+
+/**
+ * Created by miuler on 25/11/13.
+ */
+object HttpServer extends App with SimpleRoutingApp {
+
+  implicit val system = ActorSystem("my-system")
+
+  startServer(interface = "localhost", port = 8080) {
+    path("ping") {
+      get { ctx =>
+        println("\n************************************************************")
+        println(ctx)
+        println("************************************************************\n")
+        complete {
+          <h1>${multipart}</h1>
+        }
+      }
+    }
+  }
+
+}