Skip to content
This repository was archived by the owner on May 13, 2021. It is now read-only.

Commit 7430076

Browse files
germanattanasiodgterry
authored andcommitted
* Add encrypted credentials fixes watson-developer-cloud#63 * add a version to nano * Remove clouding, update travis and more cleanup * [ci skip] fix README badge * Add gif to README
1 parent 559f2c0 commit 7430076

16 files changed

+285
-299
lines changed

.cfignore

+2
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,5 @@ node_modules/
22
.idea/
33
coverage
44
npm-debug.log
5+
readme_images
6+
test

.env.example

+3-12
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,4 @@
11
# Environment variables
2-
WORKSPACE_ID=
3-
CONVERSATION_USERNAME=
4-
CONVERSATION_PASSWORD=
5-
#Optional params, delete any which are not used!
6-
#Optional params to enable Speech to text
7-
STT_USERNAME=
8-
STT_PASSWORD=
9-
#Optional cloudant URL for loggin
10-
CLOUDANT_URL=
11-
#If cloudant url is specified a user name and password must be specified to secure the logging endpoints
12-
LOG_USER=
13-
LOG_PASS=
2+
WORKSPACE_ID=<workspace-id>
3+
CONVERSATION_USERNAME=<conversation-username>
4+
CONVERSATION_PASSWORD=<conversation-password>

.eslintrc

-16
This file was deleted.

.eslintrc.yml

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
env:
2+
browser: true
3+
node: true
4+
mocha: true
5+
extends: 'eslint:recommended'
6+
rules:
7+
indent:
8+
- error
9+
- 2
10+
linebreak-style:
11+
- error
12+
- unix
13+
quotes:
14+
- error
15+
- single
16+
semi:
17+
- error
18+
- always

.travis.yml

+18-13
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,25 @@
11
language: node_js
2-
sudo: true
2+
dist: trusty
3+
sudo: required
4+
node_js: 6
5+
script:
6+
- npm run test
7+
38
cache:
49
directories:
510
- node_modules
6-
node_js: stable
7-
script:
8-
- npm run lint
9-
- npm run codecov
11+
env:
12+
global:
13+
- CF_APP=conversation-simple
14+
- CF_API=https://api.ng.bluemix.net
15+
- CF_ORGANIZATION=WatsonPlatformServices
16+
- CF_SPACE=appgallery
17+
before_deploy: npm install -g cf-blue-green
1018
deploy:
11-
provider: cloudfoundry
12-
api: https://api.ng.bluemix.net
13-
username: $CF_USERNAME
14-
password: $CF_PASSWORD
15-
name: conversation-simple
16-
organization: WatsonPlatformServices
17-
space: demos
19+
provider: script
20+
script:
21+
- cf-blue-green-travis
1822
on:
23+
branch: master
1924
repo: watson-developer-cloud/conversation-simple
20-
branch: release
25+
skip_cleanup: true

Procfile

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
web: npm start

README.md

+41-43
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
# Conversation Sample Application
2-
[![Build Status](https://travis-ci.org/watson-developer-cloud/conversation-simple.svg?branch=master)](http://travis-ci.org/watson-developer-cloud/conversation-simple)
3-
[![codecov.io](https://codecov.io/github/watson-developer-cloud/conversation-simple/coverage.svg?branch=master)](https://codecov.io/github/watson-developer-cloud/conversation-simple?branch=master)
1+
# Conversation Sample Application [![Build Status](https://travis-ci.org/watson-developer-cloud/conversation-simple.svg?branch=master)](http://travis-ci.org/watson-developer-cloud/conversation-simple) [![codecov.io](https://codecov.io/github/watson-developer-cloud/conversation-simple/coverage.svg?branch=master)](https://codecov.io/github/watson-developer-cloud/conversation-simple?branch=master)
42

53
This Node.js app demonstrates the Conversation service in a simple chat interface simulating a cognitive car dashboard.
64

5+
![Demo](readme_images/demo.gif)
6+
77
You can view a [demo][demo_url] of this app.
88

99
## Before you begin
@@ -31,7 +31,7 @@ Use GitHub to clone the repository locally, or [download the .zip file](https://
3131
1. Create an instance of the Conversation service in Bluemix. For example:
3232

3333
```bash
34-
cf create-service Conversation free conversation-simple-demo-test1
34+
cf create-service conversation free my-conversation-service
3535
```
3636

3737
### Importing the Conversation workspace
@@ -57,13 +57,13 @@ Use GitHub to clone the repository locally, or [download the .zip file](https://
5757
1. Create a service key in the format `cf create-service-key <service_instance> <service_key>`. For example:
5858

5959
```bash
60-
cf create-service-key conversation-simple-demo-test1 conversation-simple-demo-test1-key1
60+
cf create-service-key my-conversation-service myKey
6161
```
6262

6363
1. Retrieve the credentials from the service key using the command `cf service-key <service_instance> <service_key>`. For example:
6464

6565
```bash
66-
cf service-key conversation-simple-demo-test1 conversation-simple-demo-test1-key1
66+
cf service-key my-conversation-service myKey
6767
```
6868

6969
The output from this command is a JSON object, as in this example:
@@ -126,7 +126,7 @@ The chat interface is on the left, and the JSON that the JavaScript code receive
126126
capabilities
127127
greetings
128128
goodbyes
129-
129+
130130
Type a request, such as `music on` or `I want to turn on the windshield wipers`. The system understands your intent and responds. You can see the details of how your input was understood by examining the JSON data in the `Watson understands` section on the right side.
131131

132132
For example, if you type `Turn on some music`, the JSON data shows that the system understood the `turn_on` intent with a high level of confidence, along with the `appliance` entity with a value of `music`.
@@ -142,67 +142,65 @@ After you have the app deployed and running, you can explore the source files an
142142
* Modify the .js files to change the app logic.
143143
* Modify the .html file to change the appearance of the app page.
144144
* Use the Conversation tool to train the service for new intents, or to modify the dialog flow. For more information, see the [Conversation service documentation][docs_landing].
145-
145+
146146
## Deploying to Bluemix
147147

148148
You can use Cloud Foundry to deploy your local version of the app to Bluemix.
149149

150150
1. In the project root directory, open the `manifest.yml` file:
151151

152-
* In the `applications` section of the `manifest.yml` file, change the `name` value to a unique name for your version of the demo app.
153-
* In the `services` section, specify the name of the Conversation service instance you created for the demo app. If you do not remember the service name, use the `cf services` command to list all services you have created.
154-
* In the `env` section, add `WORKSPACE_ID` and specify the value from the `.env` file.
155-
156-
The following example shows a modified `manifest.yml` file:
157-
158-
```YAML
159-
---
160-
declared-services:
161-
conversation-service:
162-
label: conversation
163-
plan: free
164-
applications:
165-
- name: conversation-simple-app-test1
166-
command: npm start
167-
path: .
168-
memory: 256M
169-
instances: 1
170-
services:
171-
- conversation-simple-demo-test1
172-
env:
173-
NPM_CONFIG_PRODUCTION: false
174-
WORKSPACE_ID: fdeab5e4-0ebe-4183-8d10-6e5557a6d842
175-
```
152+
* In the `applications` section of the `manifest.yml` file, change the `name` value to a unique name for your version of the demo app.
153+
* In the `services` section, specify the name of the Conversation service instance you created for the demo app. If you do not remember the service name, use the `cf services` command to list all services you have created.
154+
155+
The following example shows a modified `manifest.yml` file:
156+
157+
```yml
158+
---
159+
declared-services:
160+
conversation-service:
161+
label: conversation
162+
plan: free
163+
applications:
164+
- name: conversation-simple-app-test1
165+
command: npm start
166+
path: .
167+
memory: 256M
168+
instances: 1
169+
services:
170+
- my-conversation-service
171+
env:
172+
NPM_CONFIG_PRODUCTION: false
173+
```
176174

177175
1. Push the app to Bluemix:
178176

179-
```bash
180-
cf push
181-
```
177+
```bash
178+
cf push
179+
```
182180

183-
Access your app on Bluemix at the URL specified in the command output.
181+
Access your app on Bluemix at the URL specified in the command output.
184182

185183
## Troubleshooting
186184

187185
If you encounter a problem, you can check the logs for more information. To see the logs, run the `cf logs` command:
188186

189-
```bash
187+
```none
190188
cf logs <application-name> --recent
191189
```
192190

193191
## License
194192

195-
This sample code is licensed under Apache 2.0.
196-
Full license text is available in [LICENSE](LICENSE).
193+
This sample code is licensed under Apache 2.0.
194+
Full license text is available in [LICENSE](LICENSE).
197195

198196
## Contributing
199197

200-
See [CONTRIBUTING](CONTRIBUTING.md).
198+
See [CONTRIBUTING](CONTRIBUTING.md).
201199

202200
## Open Source @ IBM
203201

204-
Find more open source projects on the
205-
[IBM Github Page](http://ibm.github.io/).
202+
Find more open source projects on the
203+
[IBM Github Page](http://ibm.github.io/).
206204

207205

208206
[cf_docs]: (https://www.ibm.com/watson/developercloud/doc/getting_started/gs-cf.shtml)
@@ -213,4 +211,4 @@ cf logs <application-name> --recent
213211
[docs_landing]: (http://www.ibm.com/watson/developercloud/doc/conversation/index.shtml)
214212
[node_link]: (http://nodejs.org/)
215213
[npm_link]: (https://www.npmjs.com/)
216-
[sign_up]: https://apps.admin.ibmcloud.com/manage/trial/bluemix.html?cm_mmc=WatsonDeveloperCloud-_-LandingSiteGetStarted-_-x-_-CreateAnAccountOnBluemixCLI
214+
[sign_up]: bluemix.net/registration

0 commit comments

Comments
 (0)