Search code examples
ibm-cloudmanifestworkspacewatson-conversation

Inside Bluemix cloud, is there anyway to change the WORKSPACE_ID fast?


After I made this demo app to work inside my account on Bluemix cloud https://github.com/eGlobeBizCom/food-coach, I create another workspace inside the above Watson Service Instance, and want to connect the above js code app with the second WORKSPACE_ID. Inside Bluemix cloud, in Runtime section, is there anyway to change the above ?WORKSPACE_ID fast? Or we have to change the WORKSPACE_ID manually in manifest.yml mentioned below Update conversation service workspace without changing workspace ID

After many searches on the web, no info can answer the above Q. Any suggestions are warmly welcome.


Solution

  • in this case, you can:

    1. Edit the workspace ID inside the app.js file in line #61. If this link is really the reposity you are using. But, dont miss replace the username and password from your Conversation Service, replace with Service Credentials.

    Make sure if the workspace have this format if your replace <workspace_id> inside the workspace variable:

    var workspace = "4235254-546563g-sfgsg-sgs-ggsfsegs" //test
    var workspace = '4235254-546563g-sfgsg-sgs-ggsfsegs' //test
    

    2. You can see the line have the code: process.env.WORKSPACE_ID. This is because the repository use dotenv package, you can simple edit the .env file and replace the value of the WORKSPACE_ID;

    3. You can simple add the Enviroment Variables in the IBM Bluemix too! Try:

    enter image description here

    In this case, you will click in the Runtime, and you will see the "Enviroment Variables". Replace the name with WORKSPACE_ID and the value with your workspace_id. After, restart your application.