30 lines
859 B
JavaScript
30 lines
859 B
JavaScript
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] \ '
|
|
//)
|
|
|
|
export const server = {
|
|
port: argv.port || 8080,
|
|
baseurl: argv.baseurl || '/'
|
|
}
|
|
|
|
const redis_conf = argv.redis || '127.0.0.1:6379'
|
|
export const database = {
|
|
sock: argv.sock || false,
|
|
type: 'redis',
|
|
prefix: '#memo#',
|
|
host: redis_conf.split(':')[0] || '127.0.0.1',
|
|
port: redis_conf.split(':')[1] || 6379
|
|
}
|
|
|
|
export const headerBarUrl = argv.headerBarUrl || null
|
|
export const logoUrl = argv.logoUrl || null
|
|
export const faviconUrl = argv.faviconUrl || null
|