在hyperledger-composer中部署角度应用程序 [英] Deploying an angular application in hyperledger-composer

查看:69
本文介绍了在hyperledger-composer中部署角度应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的composer-rest-server运行在端口3000上,现在我尝试按照

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.

创建网络应用的步骤:

执行npm start后,似乎可以正确创建webapp,因为我可以使用curl localhost:4200从本地主机访问它,但是当我尝试从其他主机访问它时,却什么也没得到.

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.

两台主机都已连接,因为我可以访问在端口3000上运行的composer服务器.

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

推荐答案

您需要更改Angular应用的配置信息(用于安装)-它基于您当前要配置的IP地址,您要从远程"访问':

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)更改您的Angular骨架应用-例如对于名为my-app的应用程序-其文件my-app/src/app/configuration.ts(其中my-app是生成的应用程序目录).对于您选择的网络接口/可解析主机,更改属性:

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";

成为您的IP或可解析的主机.

to be your IP or resolvable host.

2)构建后,您可以根据需要进行更改-特别是在package.json中将ng serve --host 0.0.0.0更改为ng serve --host {MY_IP}的位置(其余部分留在其中!)-请参见以下示例:

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\"",

这篇关于在hyperledger-composer中部署角度应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆