Last active
December 15, 2015 22:19
-
-
Save solidsnack/5332675 to your computer and use it in GitHub Desktop.
Suggestions from scala-user
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
| import org.scalatra._ | |
| import org.eclipse.jetty.server.Server | |
| import org.eclipse.jetty.webapp.WebAppContext | |
| object Go { | |
| def main(args: Array[String]) { | |
| val server = new Server(8080) | |
| val context = new WebAppContext() | |
| context.setContextPath("/") | |
| context.addServlet(classOf[Slash], "/*") | |
| server.setHandler(context) | |
| server.start | |
| server.join | |
| } | |
| class Slash extends ScalatraServlet { | |
| get() { | |
| contentType = "text/plain" | |
| "Welcome to /" | |
| } | |
| get("/x") { | |
| contentType = "text/plain" | |
| "Welcome to /x" | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment