forked from loafle/openapi-generator-original
20 lines
505 B
Plaintext
20 lines
505 B
Plaintext
import {{apiPackage}}._
|
|
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) {
|
|
try {
|
|
{{#apis}}
|
|
context mount (new {{className}}, "/{{name}}/*")
|
|
{{/apis}}
|
|
|
|
context mount (new ResourcesApp, "/api-docs/*")
|
|
} catch {
|
|
case e: Throwable => e.printStackTrace()
|
|
}
|
|
}
|
|
} |