cncjs
1import path from 'path';2import pkg from '../../package.json';3
4const RC_FILE = '.cncrc';5const SESSION_PATH = '.cncjs-sessions';6
7// Secret
8const secret = pkg.version;9
10const getUserHome = () => (process.env[(process.platform === 'win32') ? 'USERPROFILE' : 'HOME']);11
12export default {13rcfile: path.resolve(getUserHome(), RC_FILE),14verbosity: 0,15version: pkg.version,16
17// The secret key is loaded from the config file (defaults to "~/.cncrc")18// @see "src/app/index.js"19secret: secret,20
21// Access Token Lifetime22accessTokenLifetime: '30d', // https://github.com/zeit/ms23
24// Allow Remote Access25allowRemoteAccess: false,26
27// Express view engine28view: {29// Set html (w/o dot) as the default extension30defaultExtension: 'html',31
32// Format: <extension>: <template>33engines: [34{ // Hogan template with .html extension35extension: 'html',36template: 'hogan'37},38{ // Hogan template with .hbs extension39extension: 'hbs',40template: 'hogan'41},42{ // Hogan template with .hogan extension43extension: 'hogan',44template: 'hogan'45}46]47},48// Middleware (https://github.com/senchalabs/connect)49middleware: {50// https://github.com/expressjs/body-parser51'body-parser': {52'json': {53// maximum request body size. (default: <100kb>)54limit: '256mb'55},56'urlencoded': {57extended: true,58// maximum request body size. (default: <100kb>)59limit: '256mb'60}61},62// https://github.com/mscdex/connect-busboy63'busboy': {64limits: {65fileSize: 256 * 1024 * 1024 // 256MB66},67// immediate68// false: no immediate parsing69// true: immediately start reading from the request stream and parsing70immediate: false71},72// https://github.com/andrewrk/node-multiparty/73'multiparty': {74// Limits the amount of memory a field (not a file) can allocate in bytes. If this value is exceeded, an error event is emitted. The default size is 2MB.75maxFieldsSize: 20 * 1024 * 1024, // 20MB76
77// Limits the number of fields that will be parsed before emitting an error event. A file counts as a field in this case. Defaults to 1000.78maxFields: 100079},80// https://github.com/expressjs/morgan81'morgan': {82// The ':id' token is defined at app.js83format: ':id \x1b[1m:method\x1b[0m \x1b[33m:url\x1b[0m \x1b[34m:status\x1b[0m :response-time ms'84},85// https://github.com/expressjs/compression86'compression': {87// response is only compressed if the byte size is at or above this threshold.88threshold: 51289},90// https://github.com/expressjs/session91'session': {92path: path.resolve(getUserHome(), SESSION_PATH)93}94},95siofu: { // SocketIOFileUploader96dir: './tmp/siofu'97},98i18next: {99lowerCaseLng: true,100
101// logs out more info (console)102debug: false,103
104// language to lookup key if not found on set language105fallbackLng: 'en',106
107// string or array of namespaces108ns: [109'config',110'resource' // default111],112
113// default namespace used if not passed to translation function114defaultNS: 'resource',115
116whitelist: [117'en', // English (default)118'cs', // Czech119'de', // German120'es', // Spanish121'fr', // French122'hu', // Hungarian123'it', // Italian124'ja', // Japanese125'nb', // Norwegian126'nl', // Nederlands127'pt-br', // Portuguese (Brazil)128'pt-pt', // Portuguese (Portugal)129'ru', // Russian130'uk', // Ukraine131'tr', // Turkish132'zh-cn', // Simplified Chinese133'zh-tw' // Traditional Chinese134],135
136
137// array of languages to preload138preload: [],139
140// language codes to lookup, given set language is 'en-US':141// 'all' --> ['en-US', 'en', 'dev']142// 'currentOnly' --> 'en-US'143// 'languageOnly' --> 'en'144load: 'currentOnly',145
146// char to separate keys147keySeparator: '.',148
149// char to split namespace from key150nsSeparator: ':',151
152interpolation: {153prefix: '{{',154suffix: '}}'155},156
157detection: {158// order and from where user language should be detected159order: ['session', 'querystring', 'cookie', 'header'],160
161// keys or params to lookup language from162lookupQuerystring: 'lang',163lookupCookie: 'lang',164lookupSession: 'lang',165
166// cache user language167caches: ['cookie']168},169
170backend: {171// path where resources get loaded from172loadPath: path.resolve(__dirname, '..', 'i18n', '{{lng}}', '{{ns}}.json'),173
174// path to post missing resources175addPath: path.resolve(__dirname, '..', 'i18n', '{{lng}}', '{{ns}}.savedMissing.json'),176
177// jsonIndent to use when storing json files178jsonIndent: 4179}180}181};182