Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

update fo finatra 1.1

  • Loading branch information...
commit cd56b250d27c866f0c515f26ede5dc4896037851 1 parent efedac3
@earldouglas earldouglas authored
Showing with 6 additions and 10 deletions.
  1. +2 −6 finatra/build.sbt
  2. +4 −4 finatra/src/main/scala/scamper/Scamper.scala
View
8 finatra/build.sbt
@@ -1,11 +1,7 @@
name := "scamper-finatra"
-resolvers += "repo.juliocapote.com" at "http://repo.juliocapote.com"
+resolvers += "twttr" at "http://maven.twttr.com"
-resolvers += "scala-tools.org" at "http://scala-tools.org/repo-releases"
-
-resolvers += "repo.codahale.com" at "http://repo.codahale.com"
-
-libraryDependencies += "com.twitter" % "finatra" % "0.1.7"
+libraryDependencies += "com.twitter" % "finatra" % "1.1.0"
View
8 finatra/src/main/scala/scamper/Scamper.scala
@@ -7,14 +7,14 @@ object Scamper extends App {
val scamper = new Scamper
FinatraServer.register(scamper)
- FinatraServer.start(port = 9000)
+ FinatraServer.start()
}
class Scamper extends Controller {
- get("/fast") { request => render.body("<h1>slept for %d ms</h1>".format(sleep(0))).header("Content-Type", "text/html") }
- get("/medium") { request => render.body("<h1>slept for %d ms</h1>".format(sleep(150))).header("Content-Type", "text/html") }
- get("/slow") { request => render.body("<h1>slept for %d ms</h1>".format(sleep(300))).header("Content-Type", "text/html") }
+ get("/fast") { request => render.body("<h1>slept for %d ms</h1>".format(sleep(0))).header("Content-Type", "text/html").toFuture }
+ get("/medium") { request => render.body("<h1>slept for %d ms</h1>".format(sleep(150))).header("Content-Type", "text/html").toFuture }
+ get("/slow") { request => render.body("<h1>slept for %d ms</h1>".format(sleep(300))).header("Content-Type", "text/html").toFuture }
def sleep(ms: Long): Long = {
val start = System.currentTimeMillis
Please sign in to comment.
Something went wrong with that request. Please try again.