forked from stoplightio/prism
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsharedOptions.ts
More file actions
53 lines (46 loc) · 1.31 KB
/
sharedOptions.ts
File metadata and controls
53 lines (46 loc) · 1.31 KB
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
43
44
45
46
47
48
49
50
51
52
53
import { Dictionary } from '@stoplight/types';
import { Options } from 'yargs';
import pino from 'pino';
const sharedOptions: Dictionary<Options> = {
port: {
alias: 'p',
description: 'Port that Prism will run on.',
default: 4010,
demandOption: true,
number: true,
},
host: {
alias: 'h',
description: 'Host that Prism will listen to.',
default: '127.0.0.1',
demandOption: true,
string: true,
},
cors: {
description: 'Enables CORS headers.',
boolean: true,
default: true,
},
multiprocess: {
alias: 'm',
description: 'Forks the http server from the CLI for faster log processing.',
boolean: true,
default: process.env.NODE_ENV === 'production',
},
errors: {
description: 'Specifies whether request/response violations marked as errors will produce an error response',
required: true,
boolean: true,
default: false,
},
verboseLevel: {
alias: 'v',
description: 'Turns on verbose logging.',
default: 'info',
demandOption: true,
// log level choices: "silent" | "fatal" | "error" | "warn" | "info" | "debug" | "trace"
// custom levels like "success" and "start" are set to the same severity value as "info"
choices: Object.keys(pino.levels.values).concat('silent'),
},
};
export default sharedOptions;