Browse files

forgot the main for advanced. now fixed

  • Loading branch information...
1 parent 80611ed commit 1ab6580c5b0c9713002d413528cbb4b8ae4cc821 @paulosuzart committed Oct 14, 2011
Showing with 17 additions and 13 deletions.
  1. +17 −13 src/main/scala/codemountain/finagle/Servers.scala
View
30 src/main/scala/codemountain/finagle/Servers.scala
@@ -1,6 +1,5 @@
package codemountain.finagle
-
import org.jboss.netty.handler.codec.http.HttpRequest
import com.twitter.util.Future
import org.jboss.netty.handler.codec.http.DefaultHttpResponse
@@ -92,20 +91,25 @@ object Advanced {
object SuperAdvanced {
import Helpers._
+ def ~>(request: Request) = {
+ request.params
+ }
val superAd = ~~ {
+
case (Get, request) =>
- (Path(request.path)) match {
- case Root / "user" / Integer(id) =>
- val response = request.response
- response.setContentString("The user id is %d\n\n" format id)
- Future.value(response)
- }
+ (Path(request.path)) match {
+ case Root / "user" / Integer(id) =>
+ val response = request.response
+ response.setContentString("The user id is %d\n\n" format id)
+ Future.value(response)
+ }
}
- val serve: Server = ServerBuilder()
- .codec(new RichHttp[Request](new Http()))
- .bindTo(new InetSocketAddress(8099))
- .name("suprAd")
- .build(ExceptionFilter andThen superAd)
-
+ def main(args: Array[String]) {
+ val serve: Server = ServerBuilder()
+ .codec(new RichHttp[Request](new Http()))
+ .bindTo(new InetSocketAddress(8099))
+ .name("suprAd")
+ .build(ExceptionFilter andThen superAd)
+ }
}

0 comments on commit 1ab6580

Please sign in to comment.