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 fs from 'fs'
|
||||||
import path from 'path';
|
import path from 'path'
|
||||||
|
|
||||||
const privateFile = process.env['PRIVATE'] || 'private.json';
|
const privateFile = process.env['PRIVATE'] || 'private.json'
|
||||||
const privateData = JSON.parse(fs.readFileSync(privateFile, 'utf-8'));
|
const privateData = JSON.parse(fs.readFileSync(privateFile, 'utf-8'))
|
||||||
|
|
||||||
const indexFile = process.env['INDEX'] || 'templates/main.html';
|
const indexFile = process.env['INDEX'] || 'templates/main.html'
|
||||||
const port = process.env['PORT'] || 1800;
|
const port = process.env['PORT'] || 1800
|
||||||
|
|
||||||
const config = {
|
const config = {
|
||||||
port: port,
|
port: port,
|
||||||
pub: './',
|
pub: './',
|
||||||
|
|
||||||
db: {
|
db: {
|
||||||
uri: 'mongodb://localhost:27017/hudozka'
|
uri: 'mongodb://localhost:27017/hudozka'
|
||||||
},
|
},
|
||||||
|
|
||||||
prerender: {
|
prerender: {
|
||||||
prerender: 'http://service.prerender.io/',
|
prerender: 'http://service.prerender.io/',
|
||||||
prerenderToken: '',
|
prerenderToken: '',
|
||||||
protocol: 'https',
|
protocol: 'https',
|
||||||
host: 'art.shlisselburg.org'
|
host: 'art.shlisselburg.org'
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
|
|
||||||
export default Object.keys(privateData)
|
export default Object.keys(privateData)
|
||||||
.reduce((config, key) => {
|
.reduce((config, key) => {
|
||||||
config[key] = privateData[key];
|
config[key] = privateData[key]
|
||||||
return config;
|
return config
|
||||||
}, config);
|
}, config)
|
||||||
|
|
||||||
let redirectPath = path.join(__dirname, '../redirect.tsv');
|
let redirectPath = path.join(__dirname, '../redirect.tsv')
|
||||||
export const redirectionTable = fs.readFileSync(redirectPath, 'utf-8')
|
export const redirectionTable = fs.readFileSync(redirectPath, 'utf-8')
|
||||||
.split('\n')
|
.split('\n')
|
||||||
.map(row => row.split(/\s+/))
|
.map(row => row.split(/\s+/))
|
||||||
.map(row => {
|
.map(row => {
|
||||||
let [from, to] = row;
|
let [from, to] = row
|
||||||
return {
|
return {
|
||||||
'url': from,
|
'url': from,
|
||||||
'redirect': to
|
'redirect': to
|
||||||
}
|
}
|
||||||
});
|
})
|
||||||
|
|
||||||
export const name = 'Hudozka';
|
export const name = 'Hudozka'
|
||||||
export const host = 'art.shlisselburg.org';
|
export const host = 'art.shlisselburg.org'
|
||||||
export const protocol = 'https://';
|
export const protocol = 'https://'
|
||||||
export const homeUrl = protocol + host;
|
export const homeUrl = protocol + host
|
||||||
|
|
||||||
export const index = path.join(__dirname, indexFile);
|
export const index = path.join(__dirname, indexFile)
|
||||||
export const sitemapCacheTime = 600000;// 600 sec - cache purge period
|
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 viewMain = path.join(__dirname, 'views/main.hbs')
|
||||||
export const view404 = path.join(__dirname, 'views/404.hbs')
|
export const view404 = path.join(__dirname, 'views/404.hbs')
|
||||||
Reference in new issue
Block a user