Created
June 24, 2015 14:35
-
-
Save xuwei-k/bd74a82f4904cc025d2e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
scalaVersion := "2.11.7" | |
libraryDependencies += "com.typesafe.play" %% "play-netty-server" % "2.4.1" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import play.core.server._ | |
import play.api.routing.sird._ | |
import play.api.mvc._ | |
object PlayMini { | |
def main(args: Array[String]): Unit = { | |
val server = NettyServer.fromRouter(ServerConfig( | |
mode = play.api.Mode.Test | |
)) { | |
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