From 41f878d05cfa8a101e3d755a8429adac68e0ee52 Mon Sep 17 00:00:00 2001 From: Roman Timashev Date: Wed, 13 Sep 2017 14:14:41 +0300 Subject: [PATCH] config eslinted --- src/config.js | 70 +++++++++++++++++++++++++-------------------------- 1 file changed, 35 insertions(+), 35 deletions(-) diff --git a/src/config.js b/src/config.js index 196700fc..6e6c630c 100644 --- a/src/config.js +++ b/src/config.js @@ -1,55 +1,55 @@ -import fs from 'fs'; -import path from 'path'; +import fs from 'fs' +import path from 'path' -const privateFile = process.env['PRIVATE'] || 'private.json'; -const privateData = JSON.parse(fs.readFileSync(privateFile, 'utf-8')); +const privateFile = process.env['PRIVATE'] || 'private.json' +const privateData = JSON.parse(fs.readFileSync(privateFile, 'utf-8')) -const indexFile = process.env['INDEX'] || 'templates/main.html'; -const port = process.env['PORT'] || 1800; +const indexFile = process.env['INDEX'] || 'templates/main.html' +const port = process.env['PORT'] || 1800 const config = { - port: port, - pub: './', + port: port, + pub: './', - db: { - uri: 'mongodb://localhost:27017/hudozka' - }, + db: { + uri: 'mongodb://localhost:27017/hudozka' + }, - prerender: { - prerender: 'http://service.prerender.io/', - prerenderToken: '', - protocol: 'https', - host: 'art.shlisselburg.org' - } -}; + prerender: { + prerender: 'http://service.prerender.io/', + prerenderToken: '', + protocol: 'https', + host: 'art.shlisselburg.org' + } +} export default Object.keys(privateData) .reduce((config, key) => { - config[key] = privateData[key]; - return config; - }, config); + config[key] = privateData[key] + return config +}, config) -let redirectPath = path.join(__dirname, '../redirect.tsv'); +let redirectPath = path.join(__dirname, '../redirect.tsv') export const redirectionTable = fs.readFileSync(redirectPath, 'utf-8') .split('\n') .map(row => row.split(/\s+/)) .map(row => { - let [from, to] = row; - return { - 'url': from, - 'redirect': to - } - }); + let [from, to] = row + return { + 'url': from, + 'redirect': to + } +}) -export const name = 'Hudozka'; -export const host = 'art.shlisselburg.org'; -export const protocol = 'https://'; -export const homeUrl = protocol + host; +export const name = 'Hudozka' +export const host = 'art.shlisselburg.org' +export const protocol = 'https://' +export const homeUrl = protocol + host -export const index = path.join(__dirname, indexFile); -export const sitemapCacheTime = 600000;// 600 sec - cache purge period +export const index = path.join(__dirname, indexFile) +export const sitemapCacheTime = 600000// 600 sec - cache purge period -export const instagramToken = privateData['instagramToken']; +export const instagramToken = privateData['instagramToken'] export const viewMain = path.join(__dirname, 'views/main.hbs') export const view404 = path.join(__dirname, 'views/404.hbs')