在多个端口上运行Scalatra应用程序

时间:2015-08-31 21:10:30

标签: scala rest embedded-jetty scalatra

我正在使用Scalatra框架构建应用程序,并且需要公开一个面向外部的端点,我希望将其安装在不同的端口上。我无法看到如何配置我的应用程序

class ScalatraBootstrap extends LifeCycle {

    override def init(context: ServletContext): Unit = {
        // I would like to mount these on two different ports
        context mount (new InternalApi, "/api", "api") 
        context mount (new ExternalApi, "/") 
    }

    override def destroy(context: ServletContext): Unit = {

    }
}

有没有办法做到这一点,还是我需要在我的应用程序中运行多个Jetty服务器?非常感谢任何指导我正确方向的帮助!

0 个答案:

没有答案
相关问题