wip refacto
This commit is contained in:
parent
cf7fb776bd
commit
28071e585f
18 changed files with 2270 additions and 7587 deletions
30
config.js
30
config.js
|
@ -1,19 +1,23 @@
|
|||
const { argv } = require('yargs').usage(
|
||||
'Usage: $0 [--port INTEGER [8080]] \
|
||||
[--baseurl STRING ["/"]] \
|
||||
[--redis STRING:INT [127.0.0.1:6379]] \
|
||||
[--headerBarUrl STRING] \
|
||||
[--logoUrl STRING] \
|
||||
[--faviconUrl STRING] \ '
|
||||
)
|
||||
import yargs from 'yargs'
|
||||
import { hideBin } from 'yargs/helpers'
|
||||
const argv = yargs(hideBin(process.argv))
|
||||
.parse()
|
||||
//.usage(
|
||||
// 'Usage: $0 [--port INTEGER [8080]] \
|
||||
// [--baseurl STRING ["/"]] \
|
||||
// [--redis STRING:INT [127.0.0.1:6379]] \
|
||||
// [--headerBarUrl STRING] \
|
||||
// [--logoUrl STRING] \
|
||||
// [--faviconUrl STRING] \ '
|
||||
//)
|
||||
|
||||
exports.server = {
|
||||
export const server = {
|
||||
port: argv.port || 8080,
|
||||
baseurl: argv.baseurl || '/'
|
||||
}
|
||||
|
||||
const redis_conf = argv.redis || '127.0.0.1:6379'
|
||||
exports.database = {
|
||||
export const database = {
|
||||
sock: argv.sock || false,
|
||||
type: 'redis',
|
||||
prefix: '#memo#',
|
||||
|
@ -21,6 +25,6 @@ exports.database = {
|
|||
port: redis_conf.split(':')[1] || 6379
|
||||
}
|
||||
|
||||
exports.headerBarUrl = argv.headerBarUrl || null
|
||||
exports.logoUrl = argv.logoUrl || null
|
||||
exports.faviconUrl = argv.faviconUrl || null
|
||||
export const headerBarUrl = argv.headerBarUrl || null
|
||||
export const logoUrl = argv.logoUrl || null
|
||||
export const faviconUrl = argv.faviconUrl || null
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue