From b4d6482994e3c4c851d3ecffc4d30894ab200493 Mon Sep 17 00:00:00 2001 From: Robbie Antenesse Date: Sun, 8 Sep 2019 21:48:23 -0600 Subject: [PATCH] Move siteName to new config.json for frontend --- app/config.example.json | 3 +++ app/index.js | 2 ++ server/config.example.json | 1 - 3 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 app/config.example.json diff --git a/app/config.example.json b/app/config.example.json new file mode 100644 index 0000000..c7e9b3f --- /dev/null +++ b/app/config.example.json @@ -0,0 +1,3 @@ +{ + "siteName": "book-tracker" +} \ No newline at end of file diff --git a/app/index.js b/app/index.js index 092f5fa..8ca7dde 100644 --- a/app/index.js +++ b/app/index.js @@ -1,5 +1,6 @@ import choo from 'choo'; +import config from './config.json'; import { viewManager } from './views/manager'; const app = choo(); @@ -17,6 +18,7 @@ app.use((state, emitter) => { // Listeners emitter.on('DOMContentLoaded', () => { + document.title = config.siteName; // Emitter listeners emitter.on('render', callback => { // This is a dirty hack to get the callback to call *after* re-rendering. diff --git a/server/config.example.json b/server/config.example.json index 66a8c76..16a0a7f 100644 --- a/server/config.example.json +++ b/server/config.example.json @@ -1,6 +1,5 @@ { "port": 3000, - "siteName": "book-tracker", "jwtSecretKey": "SomethingAtLeast32CharactersLong!", "tokenExpireDays": 7 } \ No newline at end of file