Skip to Content
0

Deploy Angular 2 application built with angular-cli on SAP cloud

Jul 31, 2017 at 01:50 PM

596

avatar image
Former Member

Hello,

any leads how to deploy angular 2 application which was build with Angular-cli. I tried to deploy successfully on SAP cloud foundry but unable to launch app. I'm getting "not found" on the browser once I launch the app by provided route URL.

thanks in advance..

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

4 Answers

Jamie Cawley
Aug 08, 2017 at 11:58 AM
0

Did you define a manifest.yml?

https://docs.cloudfoundry.org/buildpacks/node/node-tips.html

Regards,

Jamie

Show 1 Share
10 |10000 characters needed characters left characters exceeded
Former Member

hi Jamie,

Yes. I did define manifest.yml file.

Sample content:

applications: - name: hcp-angular2 buildpack: nodejs_buildpack memory: 128M disk_quota: 1024M

0
Jamie Cawley
Aug 10, 2017 at 12:59 PM
0

You do not have a command listed in your manifest. Should be something like

command: node app.js

Regards

Jamie

Share
10 |10000 characters needed characters left characters exceeded
Nikolay Androsovych Oct 27, 2017 at 02:03 PM
0

Hi, not sure that answer still is necessary, but just in case might be useful for other people. For deploying angular2 app you need:

1) to use the buildpack for static content

2) to enable pushState feature in file "Staticfile" if your angular app uses default location strategy

3) In my trial account I have created html5 application and pushed code to the git repo which is created once you created html5 app. After this I was able to deploy my code on cloud foundry platform using cockpit

Share
10 |10000 characters needed characters left characters exceeded
Ivan Mirisola
Feb 20 at 02:41 PM
0

Hi shankaragouda,

Could you please share your mtar.yaml file? For Angular2 you could develop just like a HTML5 Web Module in WebIDE. All you need to do is create a new project, add a web module to it and import your angular files to it. Once this is done, the platform will create the required files to load the index.html for you.

Ensure your app has been assigned to UAA service. If you do not define one for your Angular app, it will not request authentication, thus it will be useless as SCP will not forward requests to your app before it has been authenticated. To test it, please open an URL to any of the deployed apps. It will generate a JWP token that could be shared across the same browser session. In this case, you need to past your app url on top of the existing one to not "erase" the token.

Regards,
Ivan

Share
10 |10000 characters needed characters left characters exceeded