Skip to content

Commit

Permalink
sample update
Browse files Browse the repository at this point in the history
  • Loading branch information
Alchemist85K committed Nov 15, 2017
1 parent d32ae65 commit 69e934f
Show file tree
Hide file tree
Showing 12 changed files with 94 additions and 45 deletions.
11 changes: 8 additions & 3 deletions web-live-chat/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,19 @@ If you refresh your browser window, you need to reconnect to SendBird. To retain

If you wish to issue an `access_token` for your user, modify the `connect function` in `src/sendbird.js`.

> Require that you have Node installed.
1. Install npm

npm install --save-dev
npm install

2. Modify files.
3. Create a bundle file.

webpack -p
npm run start-dev
3. Start sample.

npm start



## Advanced
Expand Down
11 changes: 5 additions & 6 deletions web-live-chat/SendBird.min.js

Large diffs are not rendered by default.

8 changes: 1 addition & 7 deletions web-live-chat/build/liveChat.SendBird.js

Large diffs are not rendered by default.

12 changes: 8 additions & 4 deletions web-live-chat/package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
{
"name": "widget-sample",
"name": "Sample-JS-Web-Live-Chat",
"version": "1.0.0",
"description": "SendBird Widget Sample",
"description": "SendBird Live Chat",
"main": "index.js",
"scripts": {
"start-dev": "webpack-dev-server",
"start": "webpack -p && node server.js",
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "SendBird",
Expand All @@ -17,9 +19,11 @@
"css-loader": "^0.27.3",
"eslint": "^3.18.0",
"eslint-loader": "^1.6.3",
"node-sass": "^4.5.0",
"express": "^4.16.2",
"node-sass": "4.5.0",
"sass-loader": "^6.0.3",
"style-loader": "^0.14.1",
"webpack": "^2.2.1"
"webpack": "^2.2.1",
"webpack-dev-server": "^2.9.4"
}
}
14 changes: 14 additions & 0 deletions web-live-chat/server.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
const express = require('express');
const app = express();

const PORT = 9001;

app.use(express.static('build'));
app.use(express.static('./'));

app.get('/', function(req, res) {
res.sendfile('index.html');
});

app.listen(PORT);
console.log(`[SERVER RUNNING] 127.0.0.1:${PORT}`);
15 changes: 12 additions & 3 deletions web-live-chat/webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,20 @@
var path = require('path');

module.exports = {
context: __dirname + '/src',
context: path.resolve(__dirname + '/src'),
entry: {
liveChat: './js/chat.js'
},
output: {
path: __dirname + '/build',
filename: '[name].SendBird.js'
path: path.resolve(__dirname + '/build'),
filename: '[name].SendBird.js',
publicPath: "build"
},
devtool: "cheap-eval-source-map",
devServer: {
publicPath: '/build/',
compress: true,
port: 9000
},
module: {
rules: [
Expand Down
10 changes: 7 additions & 3 deletions web-widget/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,18 @@ If you refresh your browser window, you need to reconnect to SendBird. To retain

If you wish to issue an `access_token` for your user, modify the `connect function` in `src/sendbird.js`.

> Require that you have Node installed.
1. Install npm

npm install --save-dev
npm install

2. Modify files.
3. Create a bundle file.

webpack -p
npm run start-dev
3. Start sample.

npm start


## Advanced
Expand Down
11 changes: 5 additions & 6 deletions web-widget/SendBird.min.js

Large diffs are not rendered by default.

8 changes: 1 addition & 7 deletions web-widget/build/widget.SendBird.js

Large diffs are not rendered by default.

10 changes: 7 additions & 3 deletions web-widget/package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
{
"name": "widget-sample",
"name": "Sample-JS-Web-Widget",
"version": "1.0.0",
"description": "SendBird Widget Sample",
"main": "index.js",
"scripts": {
"start-dev": "webpack-dev-server",
"start": "webpack -p && node server.js",
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "SendBird",
Expand All @@ -18,9 +20,11 @@
"css-loader": "^0.27.3",
"eslint": "^3.18.0",
"eslint-loader": "^1.6.3",
"node-sass": "^4.5.0",
"express": "^4.16.2",
"node-sass": "4.5.0",
"sass-loader": "^6.0.3",
"style-loader": "^0.14.1",
"webpack": "^2.2.1"
"webpack": "^2.2.1",
"webpack-dev-server": "^2.9.4"
}
}
14 changes: 14 additions & 0 deletions web-widget/server.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
const express = require('express');
const app = express();

const PORT = 9001;

app.use(express.static('build'));
app.use(express.static('./'));

app.get('/', function(req, res) {
res.sendfile('index.html');
});

app.listen(PORT);
console.log(`[SERVER RUNNING] 127.0.0.1:${PORT}`);
15 changes: 12 additions & 3 deletions web-widget/webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,20 @@
var path = require('path');

module.exports = {
context: __dirname + '/src',
context: path.resolve(__dirname + '/src'),
entry: {
widget: ['babel-polyfill', './js/widget.js']
},
output: {
path: __dirname + '/build',
filename: '[name].SendBird.js'
path: path.resolve(__dirname + '/build'),
filename: '[name].SendBird.js',
publicPath: "build"
},
devtool: "cheap-eval-source-map",
devServer: {
publicPath: '/build/',
compress: true,
port: 9000
},
module: {
rules: [
Expand Down

0 comments on commit 69e934f

Please sign in to comment.