This project deploys a simple Angular 2 app in IBM Bluemix. The Angular 2 uses the angular-cli to generate the application artifacts into the dist folder. Once generated, these artifacts are deployed to IBM Bluemix and served by the Cloud Foundry static buildpack.
-
Create a Bluemix Account
Sign up for Bluemix, or use an existing account.
-
Download and install the Cloud-foundry CLI tool
-
Clone the app to your local environment from your terminal using the following command
git clone https://github.com/l2fprod/bluemix-hello-angular2.git
-
Cd into this newly created directory
-
Install angular-cli
npm install -g angular-cli
- Install the project dependencies
npm install
- Build the project
npm run dist
This task defined in package.json compiles the Angular 2 app. In addition it copies the manifest.yml file to the dist directory together with the Staticfile. Those two are needed to deploy the dist folder with the Cloud Foundry static buildpack making it possible to serve plain HTML, CSS, JavaScript files.
- Change to the dist directory
cd dist
- Push the application to Bluemix
cf push
It will create a new app named bluemix-hello-angular2 with a random route. Watch for the route name in the cf push
output.
This project was generated with angular-cli version 1.0.0.
To troubleshoot your Bluemix app the main useful source of information is the logs. To see them, run:
cf logs <application-name> --recent
This project is a sample application created for the purpose of demonstrating the deployment of a Angular 2 app in IBM Bluemix. The program is provided as-is with no warranties of any kind, express or implied.