need to replace localhost:3000 with realip:3000 in

2019-03-02 12:47发布

问题:

I have uploaded the composer-rest-server on AWS machine , i have managed to launch without errors the composer-rest-server , although it always refer to http://localhost:3000 , i want to change my localhost to my actual host ip on AWS

can someone help ?

回答1:

You need to make your REST server available on an IP or domain resolvable hostname ie on an available network interface such that other REST clients can consume it.

Its likely your REST server (accessed through Explorer) is already listening on 0.0.0.0:3000 and hence listening on all configured interfaces (on your server). For REST server deployment more info here -> https://hyperledger.github.io/composer/integrating/deploying-the-rest-server.html

the parameter in your COMPOSER_DATASOURCES to change (if you need to change it) is here (straight out of loopback basically):

 COMPOSER_DATASOURCES='{
  "db": {
    "name": "db",
    "connector": "mongodb",
    "host": "mongo",
    "ip": "10.99.98.x"
  }
}'

referenced here -> https://hyperledger.github.io/composer/integrating/deploying-the-rest-server.html