forked from RedRoserade/watson-demo-starter
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Starter package with HTML and CSS, and minimal JS
- Loading branch information
André Carvalho
committed
Nov 20, 2017
0 parents
commit 2c9e3e4
Showing
15 changed files
with
3,161 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
.env | ||
.env.template | ||
|
||
.eslintrc | ||
.gitignore | ||
.prettierrc | ||
jsconfig.json | ||
|
||
node_modules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# Rename to ".env" and add or change what you need. | ||
|
||
# The app will listen on this port. | ||
PORT=3000 | ||
|
||
# These variables will be used to configure our application, so it can talk to Watson. | ||
WATSON_CONVERSATION_USERNAME= | ||
WATSON_CONVERSATION_PASSWORD= | ||
WATSON_CONVERSATION_WORKSPACE_ID= | ||
|
||
# When running on Bluemix, this will identify the name of the service. | ||
WATSON_CONVERSATION_SERVICE_NAME= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"plugins": ["prettier"], | ||
"parser": "babel-eslint", | ||
"rules": { | ||
"prettier/prettier": "off" | ||
}, | ||
"extends": ["prettier"], | ||
"env": { | ||
"es6": true | ||
}, | ||
"parserOptions": { | ||
"ecmaVersion": 7 | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,139 @@ | ||
|
||
# Created by https://www.gitignore.io/api/osx,node,linux,windows,visualstudiocode | ||
|
||
### VCAP ### | ||
vcap-local.json | ||
|
||
### Linux ### | ||
*~ | ||
|
||
# temporary files which can be created if a process still has a handle open of a deleted file | ||
.fuse_hidden* | ||
|
||
# KDE directory preferences | ||
.directory | ||
|
||
# Linux trash folder which might appear on any partition or disk | ||
.Trash-* | ||
|
||
# .nfs files are created when an open file is removed but is still being accessed | ||
.nfs* | ||
|
||
### Node ### | ||
# Logs | ||
logs | ||
*.log | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
|
||
# Runtime data | ||
pids | ||
*.pid | ||
*.seed | ||
*.pid.lock | ||
|
||
# Directory for instrumented libs generated by jscoverage/JSCover | ||
lib-cov | ||
|
||
# Coverage directory used by tools like istanbul | ||
coverage | ||
|
||
# nyc test coverage | ||
.nyc_output | ||
|
||
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) | ||
.grunt | ||
|
||
# Bower dependency directory (https://bower.io/) | ||
bower_components | ||
|
||
# node-waf configuration | ||
.lock-wscript | ||
|
||
# Compiled binary addons (http://nodejs.org/api/addons.html) | ||
build/Release | ||
|
||
# Dependency directories | ||
node_modules/ | ||
jspm_packages/ | ||
|
||
# Typescript v1 declaration files | ||
typings/ | ||
|
||
# Optional npm cache directory | ||
.npm | ||
|
||
# Optional eslint cache | ||
.eslintcache | ||
|
||
# Optional REPL history | ||
.node_repl_history | ||
|
||
# Output of 'npm pack' | ||
*.tgz | ||
|
||
# Yarn Integrity file | ||
.yarn-integrity | ||
|
||
# dotenv environment variables file | ||
.env | ||
|
||
|
||
### OSX ### | ||
*.DS_Store | ||
.AppleDouble | ||
.LSOverride | ||
|
||
# Icon must end with two \r | ||
Icon | ||
|
||
# Thumbnails | ||
._* | ||
|
||
# Files that might appear in the root of a volume | ||
.DocumentRevisions-V100 | ||
.fseventsd | ||
.Spotlight-V100 | ||
.TemporaryItems | ||
.Trashes | ||
.VolumeIcon.icns | ||
.com.apple.timemachine.donotpresent | ||
|
||
# Directories potentially created on remote AFP share | ||
.AppleDB | ||
.AppleDesktop | ||
Network Trash Folder | ||
Temporary Items | ||
.apdisk | ||
|
||
### VisualStudioCode ### | ||
.vscode/* | ||
!.vscode/settings.json | ||
!.vscode/tasks.json | ||
!.vscode/launch.json | ||
!.vscode/extensions.json | ||
.history | ||
|
||
### Windows ### | ||
# Windows thumbnail cache files | ||
Thumbs.db | ||
ehthumbs.db | ||
ehthumbs_vista.db | ||
|
||
# Folder config file | ||
Desktop.ini | ||
|
||
# Recycle Bin used on file shares | ||
$RECYCLE.BIN/ | ||
|
||
# Windows Installer files | ||
*.cab | ||
*.msi | ||
*.msm | ||
*.msp | ||
|
||
# Windows shortcuts | ||
*.lnk | ||
|
||
# End of https://www.gitignore.io/api/osx,node,linux,windows,visualstudiocode |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"bracketSpacing": true, | ||
"jsxBracketSameLine": false, | ||
"printWidth": 80, | ||
"semi": true, | ||
"singleQuote": false, | ||
"tabWidth": 4, | ||
"trailingComma": "none", | ||
"useTabs": false | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# Watson Demo Starter | ||
|
||
Starter package, with no code. | ||
|
||
## Running this | ||
|
||
- Clone this repository to a folder. | ||
- On a terminal, navigate to the cloned folder and run `npm install`. | ||
- Open the folder in your favourite text editor. | ||
|
||
## Configuring Watson SDK | ||
|
||
For safety reasons, the Watson SDK is configured using environment variables. | ||
|
||
A file called `.env.template` is next to this one. Copy it, and rename it to `.env`. | ||
|
||
Then, add the values you need. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
"use strict"; | ||
|
||
// Config | ||
const dotenv = require("dotenv"); | ||
|
||
// @ts-ignore | ||
dotenv.config({ silent: true }); | ||
|
||
const cfenv = require("cfenv"); | ||
|
||
// @ts-ignore | ||
const appEnv = cfenv.getAppEnv(); | ||
|
||
const services = appEnv.getServices(); | ||
|
||
const path = require("path"); | ||
|
||
const express = require("express"); | ||
const bodyParser = require("body-parser"); | ||
|
||
// TODO Configure Watson... | ||
|
||
const app = express(); | ||
|
||
app.use(express.static(path.join(__dirname, "public"))); | ||
app.use(bodyParser.json()); | ||
|
||
// TODO Make our app do things... | ||
|
||
const port = process.env.PORT || process.env.VCAP_APP_PORT || 3000; | ||
|
||
app.listen(port, () => console.log("Server listening on", port)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"compilerOptions": { | ||
"target": "es6", | ||
"lib": ["es2015", "dom"], | ||
"module": "commonjs", | ||
"checkJs": true | ||
} | ||
} |
Oops, something went wrong.