Rename /Coral.js to /embed.js

This commit is contained in:
Benjamin Goering
2017-02-04 01:48:57 +08:00
parent b9c918eb88
commit 841d6add45
4 changed files with 4 additions and 3 deletions
-1
View File
@@ -34,7 +34,6 @@ app.use(helmet({
}));
app.use(bodyParser.json());
app.use('/client', express.static(path.join(__dirname, 'dist')));
app.get('/Coral.js', (req, res) => res.sendFile(path.join(__dirname, 'client/coral-embed/index.js')));
app.set('views', path.join(__dirname, 'views'));
app.set('view engine', 'ejs');
@@ -32,7 +32,7 @@ class EmbedLink extends Component {
location.hostname,
location.port ? (`:${ window.location.port}`) : ''
].join('');
const coralJsUrl = [talkBaseUrl, '/Coral.js'].join('');
const coralJsUrl = [talkBaseUrl, '/embed.js'].join('');
const nonce = String(Math.random()).slice(2);
const streamElementId = `coral_talk_${nonce}`;
const embedText = `
+2
View File
@@ -1,9 +1,11 @@
const express = require('express');
const path = require('path');
const router = express.Router();
router.use('/api/v1', require('./api'));
router.use('/admin', require('./admin'));
router.use('/embed', require('./embed'));
router.get('/embed.js', (req, res) => res.sendFile(path.join(__dirname, '../client/coral-embed/index.js')));
router.use('/assets', require('./assets'));
router.get('/', (req, res) => {
+1 -1
View File
@@ -23,7 +23,7 @@
<p><%= body %></p>
<p><a href="/admin">Admin</a> - <a href="/assets">All Assets</a></p>
<div id='coralStreamEmbed'></div>
<script src="/Coral.js" onload="
<script src="/embed.js" onload="
Coral.Talk.render(document.getElementById('coralStreamEmbed'), {
talk: '/',
asset: <%= asset_url ? asset_url : 'undefined' %>