[www] config optimisation: removed private.json
This commit is contained in:
1 parent
ec8d18b587
commit
396b7a6d40
2 files changed
+4
-24
No files matched your search
+2
-22
@@ -1,34 +1,14 @@
|
||||
import fs from 'fs'
|
||||
import path from 'path'
|
||||
|
||||
export const configFile = process.env['PRIVATE'] || 'private.json'
|
||||
const privateData = JSON.parse(fs.readFileSync(configFile, 'utf-8'))
|
||||
|
||||
const indexFile = process.env['INDEX'] || 'templates/main.html'
|
||||
export const port = process.env['PORT'] || 1800
|
||||
|
||||
const value = (name, def) => name in privateData
|
||||
? privateData[name]
|
||||
: def
|
||||
|
||||
const config = {
|
||||
pub: './',
|
||||
}
|
||||
|
||||
export const dbUri = value('dbUri', 'mongodb://localhost:27017/hudozka')
|
||||
|
||||
export default Object.keys(privateData)
|
||||
.reduce((config, key) => {
|
||||
config[key] = privateData[key]
|
||||
return config
|
||||
}, config)
|
||||
export const dbUri = process.env['DB_URI'] || 'mongodb://localhost:27017/hudozka'
|
||||
|
||||
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 index = path.join(__dirname, 'templates/main.html')
|
||||
export const sitemapCacheTime = 600000// 600 sec - cache purge period
|
||||
|
||||
export const viewMain = path.join(__dirname, 'views/main.hbs')
|
||||
|
||||
+2
-2
@@ -11,13 +11,13 @@ const isEqualPate = require('../lib/url').isEqualPath
|
||||
const {compose, any} = require('../lib/common')
|
||||
|
||||
const menuModel = require('../models/menu').default
|
||||
const config = require('../config')
|
||||
const {viewMain} = require('../config')
|
||||
|
||||
const defaultOptions = {
|
||||
commentsEnabled: false,
|
||||
showAuthor: false,
|
||||
menuPadding: false,
|
||||
templateFile: config.viewMain,
|
||||
templateFile: viewMain,
|
||||
}
|
||||
|
||||
const defaultMeta = {
|
||||
|
||||
Reference in new issue
Block a user