Skip to content

Instantly share code, notes, and snippets.

@LeifWarner
Created August 22, 2013 17:48
Show Gist options
  • Save LeifWarner/6310506 to your computer and use it in GitHub Desktop.
Save LeifWarner/6310506 to your computer and use it in GitHub Desktop.
package com.example
import org.eclipse.jetty.server.Server
import org.eclipse.jetty.webapp.WebAppContext
import org.scalatra.servlet.MultipartConfig
object Main {
def main(args: Array[String]) {
val port = 8080
val server = new Server(port)
val context = new WebAppContext()
context.setContextPath("/")
context.setResourceBase("src/main/webapp")
val holder = context.addServlet(classOf[Facebook], "/*")
holder.getRegistration.setMultipartConfig(MultipartConfig(
maxFileSize = Some(5*1024*1024),
fileSizeThreshold = Some(1*1024*1024)
).toMultipartConfigElement)
server.setHandler(context)
server.start
server.join
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment