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.

回答1:

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.



回答2:

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.