问题描述
这是我第一次使用akka-http。我编写了下面的主类来启动应用程序:
This is the first time I'm working with akka-http. I wrote the following main class which starts the application:
object Main extends App with Routes with Config with Protocols {
implicit val system: ActorSystem = ActorSystem("slickboard-system")
implicit val executor: ExecutionContext = system.dispatcher
implicit val materializer: ActorMaterializer = ActorMaterializer()
override val employeeActor: ActorRef = system.actorOf(EmployeeActor.props, "employees")
val server = Http().bindAndHandle(route, httpServerURL, httpServerPort)
}
它在本地主机上启动服务器,但是当我尝试将其部署在远程tomcat服务器上时,它不再起作用。它以HTTP 404响应:找不到。
It starts a server on localhost, but when I try to deploy it on a remote tomcat server, it is not working anymore. It is responding with a HTTP 404: not found.
我一直在网上搜索akka-http部署,但找不到答案。有人对此问题有经验吗?
I've been searching on the web for akka-http deployment, but couldn't find an answer. Someone has experience with this probleem?
亲切的问候
推荐答案
Akka -http不应该作为servlet部署,而是一个独立的可执行文件。部署Akka应用程序的一种流行方法是使用
I've recently answered related question, but about Play
framework. Play and Akka are similar from deploy perspective, so have a look here: https://stackoverflow.com/a/35648740/371804
这篇关于AKKA-http部署的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!