Created
November 27, 2011 05:35
-
-
Save softprops/1397029 to your computer and use it in GitHub Desktop.
unfiltered embedded jetty
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
libraryDependencies += Seq( | |
"net.databinder" %% "unfiltered-filter" % "0.5.1", | |
"net.databinder" %% "unfiltered-jetty" % "0.5.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
object Main { | |
import unfiltered.jetty | |
import unfiltered.filter | |
import unfiltered.request.{GET, Path} | |
import unfiltered.response.Html | |
def main(args: Array[String]){ | |
jetty.Http(5678).filter(filter.Planify { | |
case GET(Path("/foo")) => Html(<h1>bar</h1>) | |
case GET(_) => Html(<h1>hello</h1>) | |
}).run | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment