Skip to content

Commit

Permalink
Bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
greghesp committed Oct 24, 2019
1 parent dd245fc commit aabe3bc
Show file tree
Hide file tree
Showing 25 changed files with 53 additions and 106 deletions.
4 changes: 0 additions & 4 deletions client/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta
name="description"
content="Web site created using create-react-app"
/>
<link href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,600" rel="stylesheet" />

<!--
Expand Down
9 changes: 4 additions & 5 deletions relay/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,12 @@ const indexRouter = require('./routes/index');

const app = express();

app.set('views', path.join(__dirname, 'views'));
app.set('view engine', 'jade');

app.use(logger('dev'));
app.use(express.json());
app.use(cors());
app.use(express.urlencoded({ extended: false }));
app.use(cookieParser());
app.use(express.static(path.join(__dirname, '../client/build')));
app.use(express.static(path.join(__dirname, './views')));

global.assistants = {};

Expand All @@ -43,7 +40,9 @@ app.use(function(err, req, res, next) {
res.locals.message = err.message;
res.locals.error = req.app.get('env') === 'development' ? err : {};
res.status(err.status || 500);
res.render('error');
console.log(req.body, req.query)
console.log(err)
// res.render('error');
});

module.exports = app;
6 changes: 6 additions & 0 deletions relay/routes/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,18 @@ const express = require('express');
const low = require('lowdb');

const FileSync = require('lowdb/adapters/FileSync');
const path = require('path');
const adapter = new FileSync('./bin/config.json');
const {sendTextInput} = require('../helpers/assistant.js');
const {outputFileStream, isQuietHour, updateResponses} = require('../helpers/server.js');

const router = express.Router();


router.get('/*', function(req, res) {
res.sendFile(path.join(__dirname, '../views', 'index.html'));
});

router.post('/assistant', async(req, res) => {
try {
const db = await low(adapter);
Expand Down
4 changes: 0 additions & 4 deletions relay/routes/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,6 @@ const {delay} = require('../helpers/misc');

const router = express.Router();

router.get('/', function(req, res) {
res.sendFile(path.join(__dirname, './views', 'index.html'));
});

router.post('/checkUpdate', async(req, res) => {
try {
const update = await isUpdateAvailable();
Expand Down
20 changes: 10 additions & 10 deletions relay/views/asset-manifest.json
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
{
"files": {
"main.js": "/static/js/main.b5c6986b.chunk.js",
"main.js.map": "/static/js/main.b5c6986b.chunk.js.map",
"main.js": "/static/js/main.d9c9928c.chunk.js",
"main.js.map": "/static/js/main.d9c9928c.chunk.js.map",
"runtime-main.js": "/static/js/runtime-main.e077b804.js",
"runtime-main.js.map": "/static/js/runtime-main.e077b804.js.map",
"static/css/2.2c2a6406.chunk.css": "/static/css/2.2c2a6406.chunk.css",
"static/js/2.039fc7e7.chunk.js": "/static/js/2.039fc7e7.chunk.js",
"static/js/2.039fc7e7.chunk.js.map": "/static/js/2.039fc7e7.chunk.js.map",
"static/css/2.13a88e22.chunk.css": "/static/css/2.13a88e22.chunk.css",
"static/js/2.e30ee1bd.chunk.js": "/static/js/2.e30ee1bd.chunk.js",
"static/js/2.e30ee1bd.chunk.js.map": "/static/js/2.e30ee1bd.chunk.js.map",
"index.html": "/index.html",
"precache-manifest.7510174f4df975e29654f82128dd343b.js": "/precache-manifest.7510174f4df975e29654f82128dd343b.js",
"precache-manifest.d15222740a022b83e7ad7e5806b30450.js": "/precache-manifest.d15222740a022b83e7ad7e5806b30450.js",
"service-worker.js": "/service-worker.js",
"static/css/2.2c2a6406.chunk.css.map": "/static/css/2.2c2a6406.chunk.css.map"
"static/css/2.13a88e22.chunk.css.map": "/static/css/2.13a88e22.chunk.css.map"
},
"entrypoints": [
"static/js/runtime-main.e077b804.js",
"static/css/2.2c2a6406.chunk.css",
"static/js/2.039fc7e7.chunk.js",
"static/js/main.b5c6986b.chunk.js"
"static/css/2.13a88e22.chunk.css",
"static/js/2.e30ee1bd.chunk.js",
"static/js/main.d9c9928c.chunk.js"
]
}
2 changes: 1 addition & 1 deletion relay/views/index.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<!doctype html><html lang="en"><head><meta charset="utf-8"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="description" content="Web site created using create-react-app"/><link href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,600" rel="stylesheet"/><link rel="manifest" href="/manifest.json"/><link rel="apple-touch-icon" sizes="57x57" href="/apple-icon-57x57.png"><link rel="apple-touch-icon" sizes="60x60" href="/apple-icon-60x60.png"><link rel="apple-touch-icon" sizes="72x72" href="/apple-icon-72x72.png"><link rel="apple-touch-icon" sizes="76x76" href="/apple-icon-76x76.png"><link rel="apple-touch-icon" sizes="114x114" href="/apple-icon-114x114.png"><link rel="apple-touch-icon" sizes="120x120" href="/apple-icon-120x120.png"><link rel="apple-touch-icon" sizes="144x144" href="/apple-icon-144x144.png"><link rel="apple-touch-icon" sizes="152x152" href="/apple-icon-152x152.png"><link rel="apple-touch-icon" sizes="180x180" href="/apple-icon-180x180.png"><link rel="icon" type="image/png" sizes="192x192" href="/android-icon-192x192.png"><link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png"><link rel="icon" type="image/png" sizes="96x96" href="/favicon-96x96.png"><link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png"><meta name="msapplication-TileColor" content="#ffffff"><title>Assistant Relay</title><style>body{margin:0}</style><link href="/static/css/2.2c2a6406.chunk.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div><script>!function(f){function e(e){for(var t,r,n=e[0],o=e[1],u=e[2],l=0,i=[];l<n.length;l++)r=n[l],Object.prototype.hasOwnProperty.call(c,r)&&c[r]&&i.push(c[r][0]),c[r]=0;for(t in o)Object.prototype.hasOwnProperty.call(o,t)&&(f[t]=o[t]);for(s&&s(e);i.length;)i.shift()();return p.push.apply(p,u||[]),a()}function a(){for(var e,t=0;t<p.length;t++){for(var r=p[t],n=!0,o=1;o<r.length;o++){var u=r[o];0!==c[u]&&(n=!1)}n&&(p.splice(t--,1),e=l(l.s=r[0]))}return e}var r={},c={1:0},p=[];function l(e){if(r[e])return r[e].exports;var t=r[e]={i:e,l:!1,exports:{}};return f[e].call(t.exports,t,t.exports,l),t.l=!0,t.exports}l.m=f,l.c=r,l.d=function(e,t,r){l.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},l.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},l.t=function(t,e){if(1&e&&(t=l(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(l.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var n in t)l.d(r,n,function(e){return t[e]}.bind(null,n));return r},l.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return l.d(t,"a",t),t},l.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},l.p="/";var t=this.webpackJsonpclient=this.webpackJsonpclient||[],n=t.push.bind(t);t.push=e,t=t.slice();for(var o=0;o<t.length;o++)e(t[o]);var s=n;a()}([])</script><script src="/static/js/2.039fc7e7.chunk.js"></script><script src="/static/js/main.b5c6986b.chunk.js"></script></body></html>
<!doctype html><html lang="en"><head><meta charset="utf-8"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="description" content="Web site created using create-react-app"/><link href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,600" rel="stylesheet"/><link rel="manifest" href="/manifest.json"/><link rel="apple-touch-icon" sizes="57x57" href="/apple-icon-57x57.png"><link rel="apple-touch-icon" sizes="60x60" href="/apple-icon-60x60.png"><link rel="apple-touch-icon" sizes="72x72" href="/apple-icon-72x72.png"><link rel="apple-touch-icon" sizes="76x76" href="/apple-icon-76x76.png"><link rel="apple-touch-icon" sizes="114x114" href="/apple-icon-114x114.png"><link rel="apple-touch-icon" sizes="120x120" href="/apple-icon-120x120.png"><link rel="apple-touch-icon" sizes="144x144" href="/apple-icon-144x144.png"><link rel="apple-touch-icon" sizes="152x152" href="/apple-icon-152x152.png"><link rel="apple-touch-icon" sizes="180x180" href="/apple-icon-180x180.png"><link rel="icon" type="image/png" sizes="192x192" href="/android-icon-192x192.png"><link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png"><link rel="icon" type="image/png" sizes="96x96" href="/favicon-96x96.png"><link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png"><meta name="msapplication-TileColor" content="#ffffff"><title>Assistant Relay</title><style>body{margin:0}</style><link href="/static/css/2.13a88e22.chunk.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div><script>!function(f){function e(e){for(var t,r,n=e[0],o=e[1],u=e[2],l=0,i=[];l<n.length;l++)r=n[l],Object.prototype.hasOwnProperty.call(c,r)&&c[r]&&i.push(c[r][0]),c[r]=0;for(t in o)Object.prototype.hasOwnProperty.call(o,t)&&(f[t]=o[t]);for(s&&s(e);i.length;)i.shift()();return p.push.apply(p,u||[]),a()}function a(){for(var e,t=0;t<p.length;t++){for(var r=p[t],n=!0,o=1;o<r.length;o++){var u=r[o];0!==c[u]&&(n=!1)}n&&(p.splice(t--,1),e=l(l.s=r[0]))}return e}var r={},c={1:0},p=[];function l(e){if(r[e])return r[e].exports;var t=r[e]={i:e,l:!1,exports:{}};return f[e].call(t.exports,t,t.exports,l),t.l=!0,t.exports}l.m=f,l.c=r,l.d=function(e,t,r){l.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},l.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},l.t=function(t,e){if(1&e&&(t=l(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(l.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var n in t)l.d(r,n,function(e){return t[e]}.bind(null,n));return r},l.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return l.d(t,"a",t),t},l.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},l.p="/";var t=this.webpackJsonpclient=this.webpackJsonpclient||[],n=t.push.bind(t);t.push=e,t=t.slice();for(var o=0;o<t.length;o++)e(t[o]);var s=n;a()}([])</script><script src="/static/js/2.e30ee1bd.chunk.js"></script><script src="/static/js/main.d9c9928c.chunk.js"></script></body></html>
22 changes: 0 additions & 22 deletions relay/views/precache-manifest.536bbf809db62ab5182dc366fa294239.js

This file was deleted.

22 changes: 0 additions & 22 deletions relay/views/precache-manifest.7510174f4df975e29654f82128dd343b.js

This file was deleted.

22 changes: 22 additions & 0 deletions relay/views/precache-manifest.d15222740a022b83e7ad7e5806b30450.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
self.__precacheManifest = (self.__precacheManifest || []).concat([
{
"revision": "955d50ff83105aa3ad6fc1c34203df50",
"url": "/index.html"
},
{
"revision": "24864cd5aaeae0aac09e",
"url": "/static/css/2.13a88e22.chunk.css"
},
{
"revision": "24864cd5aaeae0aac09e",
"url": "/static/js/2.e30ee1bd.chunk.js"
},
{
"revision": "d5d6800a6a98db158a36",
"url": "/static/js/main.d9c9928c.chunk.js"
},
{
"revision": "875d570ce1b6fc43afc6",
"url": "/static/js/runtime-main.e077b804.js"
}
]);
22 changes: 0 additions & 22 deletions relay/views/precache-manifest.e24381b84d16bf8a68754edeb065bd59.js

This file was deleted.

2 changes: 1 addition & 1 deletion relay/views/service-worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
importScripts("https://storage.googleapis.com/workbox-cdn/releases/4.3.1/workbox-sw.js");

importScripts(
"/precache-manifest.7510174f4df975e29654f82128dd343b.js"
"/precache-manifest.d15222740a022b83e7ad7e5806b30450.js"
);

self.addEventListener('message', (event) => {
Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

2 changes: 0 additions & 2 deletions relay/views/static/js/2.039fc7e7.chunk.js

This file was deleted.

1 change: 0 additions & 1 deletion relay/views/static/js/2.039fc7e7.chunk.js.map

This file was deleted.

2 changes: 0 additions & 2 deletions relay/views/static/js/2.d3fc89a2.chunk.js

This file was deleted.

1 change: 0 additions & 1 deletion relay/views/static/js/2.d3fc89a2.chunk.js.map

This file was deleted.

2 changes: 2 additions & 0 deletions relay/views/static/js/2.e30ee1bd.chunk.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions relay/views/static/js/2.e30ee1bd.chunk.js.map

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion relay/views/static/js/main.0b3ce9eb.chunk.js.map

This file was deleted.

2 changes: 0 additions & 2 deletions relay/views/static/js/main.b5c6986b.chunk.js

This file was deleted.

1 change: 0 additions & 1 deletion relay/views/static/js/main.b5c6986b.chunk.js.map

This file was deleted.

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions relay/views/static/js/main.d9c9928c.chunk.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion release.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ if (!fs.existsSync(dir)) fs.mkdirSync(dir);
ncp('./relay/bin/', './release/bin');
ncp('./relay/helpers/', './release/helpers');
ncp('./relay/routes/', './release/routes');
ncp('./relay/views/', './release/views');
ncp('./client/build/', './release/views');
ncp('./relay/app.js', './release/app.js');
ncp('./relay/package.json', './release/package.json');
ncp('./relay/package-lock.json', './release/package-lock.json');
Expand Down

0 comments on commit aabe3bc

Please sign in to comment.