Skip to content
This repository has been archived by the owner on Jul 20, 2023. It is now read-only.

Commit

Permalink
moving files around - serve the chat from heroku instead of github pages
Browse files Browse the repository at this point in the history
  • Loading branch information
idoco committed Jan 17, 2017
1 parent b0c6f81 commit c5611b0
Show file tree
Hide file tree
Showing 8 changed files with 48 additions and 21 deletions.
4 changes: 2 additions & 2 deletions chat.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
<body>

<div id="intergramChat"></div>
<script src="static/chat.js"></script>
<audio id="messageSound" src="ping.mp3" preload="auto"></audio>
<script src="js/chat.js"></script>
<audio id="messageSound" src="media/ping.mp3" preload="auto"></audio>

</body>
</html>
41 changes: 41 additions & 0 deletions demo.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<!doctype html>
<html>
<head>
<title>Intergram Demo Page</title>

<meta charset="utf-8" />
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />

<style type="text/css">
body {
background-color: #f0f0f2;
margin: 0;
padding: 0;
font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
}

.main {
width: 600px;
margin: 5em auto;
padding: 50px;
background-color: #fff;
border-radius: 1em;
}
</style>

</head>
<body>

<div class="main">
<h1>Intergram Demo Page</h1>
<p>Free live chat widget linked to your telegram messenger. </p>

<p><a href="https://github.com/idoco/intergram">More information...</a></p>
</div>

<script> window.intergramId = 312940879; window.intergramFrameSrc = '/chat.html' </script>
<script src="/js/widget.js"></script>

</body>
</html>
14 changes: 0 additions & 14 deletions index.html

This file was deleted.

File renamed without changes.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"start": "node server.js",
"postinstall": "npm run build",
"dev": "node devServer.js",
"build": "shx mkdir -p dist && shx cp *.html dist && shx cp ping.mp3 dist && shx cp -r ./css dist && webpack -p",
"build": "shx mkdir -p dist && shx cp *.html dist && shx cp -r ./media dist && shx cp -r ./css dist && webpack -p",
"test": "npm run -s lint",
"lint": "eslint src",
"deploy": "gh-pages -d dist"
Expand Down
2 changes: 1 addition & 1 deletion server.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const http = require('http').Server(app);
const io = require('socket.io')(http);
const request = require('request');

app.use(express.static('dist'));
app.use(express.static('dist', {index: 'demo.html'}));
app.use(compression());
app.use(bodyParser.json());

Expand Down
4 changes: 2 additions & 2 deletions src/widget/ChatFrame.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ export default class ChatFrame extends Component {
}

render() {
const frameSrc = window.intergramFrameSrc || 'https://intergram.herokuapp.com/chat.html';
return (
// Using a static link to GitHub pages - this might be confusing during development!
<iframe src={'https://idoco.github.io/intergram/chat.html?id=' + window.intergramId }
<iframe src={frameSrc + '?id=' + window.intergramId}
width='300' height='350' frameborder='0'>
</iframe>
);
Expand Down
2 changes: 1 addition & 1 deletion webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ module.exports = {
],
},
output: {
path: path.join(__dirname, 'dist', 'static'),
path: path.join(__dirname, 'dist', 'js'),
filename: '[name].js',
publicPath: '/static/'
},
Expand Down

0 comments on commit c5611b0

Please sign in to comment.