gpt4 book ai didi

java - 如何使用 Nginx 和 dropwizard 部署 angularjs 应用程序前端

转载 作者:搜寻专家 更新时间:2023-10-30 20:02:47 27 4
gpt4 key购买 nike

我正在使用具有后端 dropwizard 的 angularjs 应用程序前端开发一个应用程序。我计划使用 Nginx 作为后端 dropwizard 服务器的网关和 Assets 服务器(图像,也许还有 angularjs 应用程序)。

我的问题是最好的部署策略是什么:

  1. 将 angularjs 与 dropwizard 后端捆绑在一起并使用 nginx 作为前端?
  2. 在 nginx 服务器上部署 angularjs 应用程序?

提前致谢

最佳答案

我会将 nginx 用作 API Gateway将您的请求路由到您的后端。

Implement an API gateway that is the single entry point for all clients. The API gateway handles requests in one of two ways. Some requests are simply proxied/routed to the appropriate service. It handles other requests by fanning out to multiple services.

使用网关,您可以根据需要灵活地更改后端。因为 nginx 仅作为网关工作,他还可以为您的静态文件 (angularjs) 提供服务。网关具有更多优势,例如日志记录、身份验证等。

关于java - 如何使用 Nginx 和 dropwizard 部署 angularjs 应用程序前端,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30307216/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com