- https://www.playframework.com/documentation/2.4.x/ScalaEmbeddingPlay
- https://www.playframework.com/documentation/2.4.x/ScalaSirdRouter
- http://eed3si9n.com/scripting-with-scala
- http://www.scala-sbt.org/0.13/docs/Scripts.html
- https://github.com/playframework/playframework/blob/2.4.6/framework/src/play-server/src/main/scala/play/core/server/ServerConfig.scala
- https://github.com/playframework/playframework/blob/2.4.6/framework/src/play-netty-server/src/main/scala/play/core/server/NettyServer.scala#L234
-
-
Save pomadchin/fa8aef5004f465edd038 to your computer and use it in GitHub Desktop.
came back play mini!
This file contains hidden or 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
#!/usr/bin/env scalas | |
/*** | |
scalaVersion := "2.11.7" | |
libraryDependencies += "com.typesafe.play" %% "play-netty-server" % "2.4.6" | |
*/ | |
import play.core.server._ | |
import play.api.routing.sird._ | |
import play.api.mvc._ | |
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