-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathbin.js
More file actions
executable file
·42 lines (34 loc) · 783 Bytes
/
bin.js
File metadata and controls
executable file
·42 lines (34 loc) · 783 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#! /usr/bin/env node
'use strict'
const fs = require('fs')
const path = require('path')
const options = require('getopts')(process.argv.slice(2), {
alias: {
h: 'help',
s: 'sample-config'
},
boolean: [
'help',
'sample-config'
]
})
const help =
`
Starts the JSCAS web server.
Usage: jscas-server <options>
where <options> are:
--help, -h: print this help message and quit
--sample-config, -s: dump an example server configuration, as YAML,
to stdout and quit
`
if (options.help) {
console.log(help)
process.exit(0)
}
if (options['sample-config']) {
console.log(
fs.readFileSync(path.join(__dirname, 'examples', 'production.yaml')).toString()
)
process.exit(0)
}
require('./server')