-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
/
Copy pathserve.ts
124 lines (122 loc) · 3.17 KB
/
serve.ts
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
const completionSpec: Fig.Spec = {
name: "serve",
description: "Static file serving and directory listing",
args: {
name: "location",
template: "folders",
},
options: [
{
name: ["-h", "--help"],
description: "Shows help message",
},
{
name: ["-v", "--version"],
description: "Displays the current version of serve",
},
{
name: ["-l", "--listen"],
description:
"Specify a URI endpoint on which to listen - more than one may be specified to listen in multiple places",
args: {
name: "listen_uri",
suggestions: [
{
name: "port",
description: "E.g. serve --listen 1234",
insertValue: "1234",
priority: 100,
},
{
name: "host/port",
description: "E.g. serve --listen tcp://hostname:1234",
insertValue: "tcp://hostname:1234",
priority: 76,
},
{
name: "unix domain",
description: "E.g. serve --listen unix:/path/to/socket.sock",
insertValue: "unix:/path/to/socket.sock",
},
{
name: "windows pipe",
description: "E.g. serve -l pipe:\\.pipePipeName",
insertValue: "pipe:\\.pipePipeName",
},
],
},
},
{
name: "-p",
description: "Specify custom port",
args: { name: "port" },
},
{
name: ["-d", "--debug"],
description: "Show debugging information",
},
{
name: ["-s", "--single"],
description: "Rewrite all not-found requests to `index.html`",
},
{
name: ["-c", "--config"],
description: "Specify custom path to `serve.json`",
args: {
name: "path to config file",
template: "filepaths",
},
},
{
name: ["-C", "--cors"],
description: "Enable CORS, sets `Access-Control-Allow-Origin` to `*`",
},
{
name: ["-n", "--no-clipboard"],
description: "Do not copy the local address to the clipboard",
},
{
name: ["-u", "--no-compression"],
description: "Do not compress files",
},
{
name: "--no-etag",
description: "Send `Last-Modified` header instead of `ETag`",
},
{
name: ["-S", "--symlinks"],
description: "Resolve symlinks instead of showing 404 errors",
},
{
name: "--ssl-cert",
description:
"Optional path to an SSL/TLS certificate to serve with HTTPS",
args: {
name: "path to SSL/TLS certificate",
template: "filepaths",
},
},
{
name: "--ssl-key",
description: "Optional path to the SSL/TLS certificate's private key",
args: {
name: "path to private key",
template: "filepaths",
},
},
{
name: "--ssl-pass",
description: "Optional path to the SSL/TLS certificate's passphrase",
args: {
name: "path to passphrase",
template: "filepaths",
},
},
{
name: "--no-port-switching",
description:
"Do not open a port other than the one specified when it's taken",
},
],
};
export default completionSpec;