Deploying an angular application in hyperledger-composer

我们两清 提交于 2019-12-06 16:58:59

问题


I have my composer-rest-server running on port 3000 and now I try to generate an angular application with yo hyperledger-composer following the tutorial.

Steps creating the webapp:

After I do npm start and it seems that the webapp es correctly created because I am able to reach it from the localhost with curl localhost:4200 but when I try to reach it from another host I get nothing.

Both hosts are connected because I can reach the composer server running on port 3000.


回答1:


you need to change your Angular app's configuration info (for the install) - it is based on your currently configured IP address, that you want to access from 'remote':

1) Change your Angular skeleton app - eg. for application named my-app - its the file my-app/src/app/configuration.ts (where my-app is the generated app dir). For the network interface/resolvable host you chose, change the property:

public ApiIP: string = "localhost";

to be your IP or resolvable host.

2) After building, you can change it as you wish - specifically where it says ng serve --host 0.0.0.0 to ng serve --host {MY_IP} in your package.json(leave the rest in!)- see example below:

    "start": "concurrently \"ng serve --host 10.0.0.1\" \"npm run my-app\"",


来源:https://stackoverflow.com/questions/47262477/deploying-an-angular-application-in-hyperledger-composer

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!