scalatra.Bootstrap.mustache Maven / Gradle / Ivy
The newest version!
import {{apiPackage}}._
import akka.actor.ActorSystem
import com.wordnik.swagger.app.{ResourcesApp, SwaggerApp}
import javax.servlet.ServletContext
import org.scalatra.LifeCycle
class ScalatraBootstrap extends LifeCycle {
implicit val swagger = new SwaggerApp
override def init(context: ServletContext) {
implicit val system = ActorSystem("appActorSystem")
try {
{{#apiInfo}}{{#apis}}context mount (new {{classname}}, "/{{baseName}}/*")
{{/apis}}{{/apiInfo}}
context mount (new ResourcesApp, "/api-docs/*")
} catch {
case e: Throwable => e.printStackTrace()
}
}
}