2017-03-09 4 views
1

J'essaye de déployer mon angular2 application à pivotal cloud foundry et j'ai suivi les instructions trouvées here mais je reçois toujours Loading..., il n'y a pas d'erreur dans la console de développeur.déployant l'application angular2 en pcf

/d/gitmyworkspace/mywork/pcfdeploy/src 
$ npm install --quite 
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected]^1.0.0 (node_modules\chokidar\node_modules\fsevents): 
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"}) 
/d/gitmyworkspace/mywork/pcfdeploy/src 
$ cf push -b staticfile_buildpack ang-pcf-dep 
Creating app ang-pcf-dep in org ORG/space development as myDetails...OK 
Creating route ang-pcf-dep.domain.com... OK 
Binding ang-pcf-dep.domain.com to ang-pcf-dep... OK 
Uploading ang-pcf-dep... 
Uploading app files from: D:\gitmyworkspace\mywork\pcfdeploy\src 
Uploading 12.9K, 18 files Done uploading OK 
Starting app ang-pcf-dep in org ORG/space development as myDetails... 
Downloading staticfile_buildpack...Downloaded staticfile_buildpack 
Creating container Successfully created container Downloading app package... 
Downloaded app package (6.4K) Staging... 
-------> Buildpack version 1.3.6 
Downloaded [file:///tmp/buildpacks/5d1fcb59173496506d68186968a7b83f/dependencies/https___pivotal-buildpacks.s3.amazonaws.com_concourse-binaries_nginx_nginx-1.9.14-linux-x64.tgz] 
grep: Staticfile: No such file or directory 
-----> Using root folder 
-----> Copying project files into public/ 
-----> Setting up nginx 
grep: Staticfile: No such file or directory 
grep: Staticfile: No such file or directory 
Exit status 0 
Staging complete 
Uploading droplet, build artifacts cache... 
Uploading build artifacts cache... 
Uploading droplet... 
Uploaded build artifacts cache (107B) 
Uploaded droplet (2.5M) 
Uploading complete 
1 of 1 instances running 
App started OK 
App ang-pcf-dep was started using this command `sh boot.sh` 
Showing health and status for app ang-pcf-dep in org ORG /spacedevelopment as myDetails ... OK 
requested state: started 
instances: 1/1 
usage: 1G x 1 instances 
urls: ang-pcf-dep.domain.com 
last uploaded: Thu Mar 9 18:53:22 UTC 2017 
stack: cflinuxfs2 
buildpack: staticfile_buildpack 
state  since     cpu memory  disk   details 
#0 running 2017-03-09 10:53:34 AM 0.0% 3.2M of 1G 6.9M of 1G 

Dans le navigateur, il est en train de charger seulement les index.html mais pas les autres composants comme app.component.html. Je viens de créer une application de base en utilisant webstorm AngularCli et node 6.9.5 pour tester le pcf deployment. S'il vous plaît laissez-moi savoir si j'ai raté quelque chose?

Répondre

3

Pour AngularCli nous supposons faire étapes ci-dessous ...

$ng build 
$ cd dist 
$ cf push -b staticfile_buildpack ang-pcf-dep 

s'il vous plaît noter pour AngularCli vous devez pousser à partir dist dossier ne app ou src dossier et tous les fichiers de ressources comme les images doivent être dans le dossier assets. Merci à Rob de pcf.