How can I deploy my angular 2 app on tomcat or jbo

2019-07-18 09:40发布

I have built a basic angular 2 app. However I need to deploy it on Jboss or Tomcat as I need to use it along with my Java EE application.

Thanks for your help.

2条回答
放我归山
2楼-- · 2019-07-18 09:47

If you are using angular-cli you can use ng build command. It creates all static files for deploy Angular2 app into the dist folder. You must copy and paste them in webresources folder of your Web Application (WAR). At the moment I am looking for how to deploy this files easier.

查看更多
3楼-- · 2019-07-18 09:57

You would use a bundler such as angular-cli or webpack to create the production bundle which is then served by the HTTP server. The bundler creates all required file that go into the htdocs directory. Normally Angular apps are completely decoupled from your backend server so there shouldn't be any JBoss or Tomcat specifics.

The Angular team are going to increasingly focus on angular-cli as the premier bundling solution so it might be a good idea to start there.

查看更多
登录 后发表回答