Skip to content

Instantly share code, notes, and snippets.

@matterche
Forked from xuwei-k/PlayMini.scala
Last active August 29, 2015 14:23
Show Gist options
  • Save matterche/f8d93652072fc3bbf236 to your computer and use it in GitHub Desktop.
Save matterche/f8d93652072fc3bbf236 to your computer and use it in GitHub Desktop.
#!/usr/bin/env scalas
/***
scalaVersion := "2.11.7"
libraryDependencies += "com.typesafe.play" %% "play-netty-server" % "2.4.1"
*/
import play.core.server._
import play.api.routing.sird._
import play.api.mvc._
val server = NettyServer.fromRouter(ServerConfig(
mode = play.api.Mode.Test,
port = Some(9000)
)) {
case GET(p"/hello/$to") => Action {
Results.Ok(s"Hello $to")
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment