config eslinted
This commit is contained in:
1 parent
b0b518fd8c
commit
41f878d05c
1 file changed
+35
-35
+35
-35
@@ -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')
|
||||
Reference in new issue
Block a user