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
var webpack = require('webpack'); | |
var path = require('path'); | |
// Build Directory | |
// Webpack will put the bundled assets in this directory. | |
var BUILD_DIR = path.resolve(__dirname, 'build'); | |
// App directory | |
// Our source code lies here. | |
var APP_DIR = path.resolve(__dirname, 'src'); |
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
{ | |
"name": "hello-react", | |
"version": "1.0.0", | |
"description": "hello react", | |
"main": "index.js", | |
"scripts": { | |
"test": "echo \"Error: no test specified\" && exit 1" | |
}, | |
"author": "Arjun Hariharan", | |
"license": "ISC" |
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
Show hidden characters
{ | |
"presets" : ["es2015", "react"] | |
} |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="UTF-8" /> | |
<title>Hello-React</title> | |
</head> | |
<body> | |
<!-- React will render the contents in side the root div.--> | |
<div id="root"></div> |
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
import React, {Component} from 'react'; | |
import {render} from 'react-dom'; | |
let rootElement = document.getElementById('root'); | |
class App extends Component { | |
render() { | |
return ( | |
<h1> Hello World </h1> | |
) |
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
{ | |
"name": "hello-react", | |
"version": "1.0.0", | |
"description": "hello react", | |
"main": "index.js", | |
"scripts": { | |
"test": "echo \"Error: no test specified\" && exit 1" | |
}, | |
"author": "Arjun Hariharan", | |
"license": "ISC", |
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
let Botkit = require('botkit'); | |
let rasa = require('./Middleware/rasa')({rasa_uri: 'http://localhost:5000'}); | |
let controller = Botkit.slackbot({ | |
clientId: process.env.clientId, | |
clientSecret: process.env.clientSecret, | |
scopes: ['bot'], | |
json_file_store: __dirname + '/.db/' | |
}); |
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
controller.hears(['device_failure'], 'direct_message,direct_mention,mention', | |
function (bot, message) { | |
let reply = 'Try pressing the power button for 30 seconds. '; | |
reply += 'Bring the phone to the service center if it does not start. '; | |
reply += 'Don't forget to carry your warranty card.'; | |
bot.reply(message, reply); | |
}); |
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
{ | |
"rasa_nlu_data": { | |
"common_examples": [ | |
{ | |
"text": "hi", | |
"intent": "greet", | |
"entities": [] | |
}, | |
{ | |
"text": "my phone isn't turning on.", |
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
'use strict'; | |
let request = require('request'); | |
module.exports = function(config) { | |
if (!config) { | |
config = {}; | |
} | |
if (!config.rasa_uri) { |