How do I deploy an Angular 2 app on Bluemix?

前端 未结 4 1442
北海茫月
北海茫月 2021-01-14 12:32

I have tried to deploy a few basic Angular 2 projects on Bluemix and got only errors after the build.

Did anybody manage to have Angular 2 working on Bluemix? In tha

相关标签:
4条回答
  • 2021-01-14 12:54

    There are a few ways to deploy an angular2 app to Bluemix.

    1. You can export your static files and push the dist folder along with manifest.yml file https://docs.cloudfoundry.org/buildpacks/staticfile/index.html

    2. You can deploy your app in a Docker container with your nginx.conf file

    I highly recommend deploying the app in a Docker container. It will give you more freedom in development.

    Here is a post I find really useful. http://heidloff.net/article/angular-2-bluemix-docker-nginx

    I hope this can help

    0 讨论(0)
  • I created a sample app using Frederic Lavigne's sample project and deployed it to bluemix. https://github.com/joeydeluca/petstore-client-angular2

    0 讨论(0)
  • 2021-01-14 13:08

    There is a new angular2-on-bluemix example created from the official AngularJs 2 tutorial (Tour of Heroes): https://github.com/nnworkspace/angular2-heroes-bluemix

    0 讨论(0)
  • 2021-01-14 13:14

    It would be great to post a sample or a link to your source code. But from the two log lines it sounds like you are trying to deploy the Angular 2 app including the Node.js tooling it comes with.

    As pointed by the previous comment, you'd rather build your Angular 2 app and deploy the resulting files, keeping the Node.js tooling for your local development.

    I've put together a sample doing just that https://github.com/l2fprod/bluemix-hello-angular2. Consider it an even simpler version of the above example.

    It is a new project generated with the angular-cli, then I did the minimum required changes to deploy the build to Bluemix.

    0 讨论(0)
提交回复
热议问题