Skip to content

Instantly share code, notes, and snippets.

@softprops
Created November 27, 2011 05:35
Show Gist options
  • Save softprops/1397029 to your computer and use it in GitHub Desktop.
Save softprops/1397029 to your computer and use it in GitHub Desktop.
unfiltered embedded jetty
libraryDependencies += Seq(
"net.databinder" %% "unfiltered-filter" % "0.5.1",
"net.databinder" %% "unfiltered-jetty" % "0.5.1",
)
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