问题
We're using IBM RAD for development and IBM Websphere Application Server as our web app server here at work. Give these constraints, would it still be possible to develop and deploy Angular SPAs? Like install a Typescript plugin for RAD probably, but how will you deploy it to WAS if there are no EAR files generated?
回答1:
You'll need to create a web module (if you haven't already) and package the result of the Angular build (the contents of the dist/
directory, by default in Angular 2) into the root of your web module, so that it can be served as static content. In Eclipse, the contents of the WebContent folder are placed in the root of the war. Then let RAD package up your web module into a war and possibly ear and deploy it.
That web module should have the following in web.xml in your web module, in order to allow deep links to be redirected back to the SPA so the router can route them properly:
<error-page>
<error-code>404</error-code>
<location>/</location>
</error-page>
来源:https://stackoverflow.com/questions/49201009/is-it-possible-to-deploy-angular-app-on-ibm-websphere-application-server