gpt4 book ai didi

java - 在 Wildfly 中部署 Angular 应用程序及其正在使用的 REST api?

转载 作者:塔克拉玛干 更新时间:2023-11-03 03:38:15 24 4
gpt4 key购买 nike

我制作了一个仅使用我的 REST api 后端的 AngularJs 应用程序(用 Java 构建并部署在 Wildfly 上)。

我使用我的公共(public) IP 地址(通过端口转发)从 Internet 访问我的服务器。

我的问题是如何使用我的公共(public) IP 从 Internet 访问 Angular 应用程序。我也可以在 Wildfly 上部署它吗?我该怎么做?

最佳答案

如果您不想部署 WAR/EAR,请尝试在您的 standalone.xml 配置文件中定义一个处理程序:

<server name="default-server">
<http-listener name="default" socket-binding="http"/>
<host name="default-host" alias="localhost">
<location name="/" handler="welcome-content"/>
<location name="/yourapp" handler="static"/>
</host>
</server>
<handlers>
<file name="welcome-content" path="${jboss.home.dir}/welcome-content" directory-listing="true"/>
<file name="static" path="/var/yourapp" directory-listing="true"/>
</handlers>

关于java - 在 Wildfly 中部署 Angular 应用程序及其正在使用的 REST api?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34395717/

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