@node-cli/static-server 1.1.0 → 1.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/defaults.js.map +1 -1
- package/dist/directories.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/logs.js.map +1 -1
- package/dist/not-found.d.ts +1 -0
- package/dist/not-found.js +57 -0
- package/dist/not-found.js.map +1 -0
- package/dist/parse.js.map +1 -1
- package/dist/server.js +7 -7
- package/dist/server.js.map +1 -1
- package/dist/utilities.js.map +1 -1
- package/package.json +5 -8
package/dist/defaults.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/defaults.ts"],"sourcesContent":["export const defaultFlags = {\n\tcache: 0,\n\tcors: false,\n\tdirs: false,\n\tgzip: true,\n\thttp2: false,\n\tlogs: false,\n\topen: false,\n\tport: 8080,\n};\n\nexport const defaultParameters = {\n\t\"0\": `${process.cwd()}/`,\n};\n"],"names":["defaultFlags","cache","cors","dirs","gzip","http2","logs","open","port","defaultParameters","process","cwd"],"mappings":"AAAA,OAAO,MAAMA,eAAe;IAC3BC,OAAO;IACPC,MAAM
|
|
1
|
+
{"version":3,"sources":["../src/defaults.ts"],"sourcesContent":["export const defaultFlags = {\n\tcache: 0,\n\tcors: false,\n\tdirs: false,\n\tgzip: true,\n\thttp2: false,\n\tlogs: false,\n\topen: false,\n\tport: 8080,\n};\n\nexport const defaultParameters = {\n\t\"0\": `${process.cwd()}/`,\n};\n"],"names":["defaultFlags","cache","cors","dirs","gzip","http2","logs","open","port","defaultParameters","process","cwd"],"mappings":"AAAA,OAAO,MAAMA,eAAe;IAC3BC,OAAO;IACPC,MAAM;IACNC,MAAM;IACNC,MAAM;IACNC,OAAO;IACPC,MAAM;IACNC,MAAM;IACNC,MAAM;AACP,EAAE;AAEF,OAAO,MAAMC,oBAAoB;IAChC,KAAK,CAAC,EAAEC,QAAQC,MAAM,CAAC,CAAC;AACzB,EAAE"}
|
package/dist/directories.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/directories.ts"],"sourcesContent":["type DirectoriesAndFiles = { href: string; name: string }[];\n\nexport const renderDirectories = (\n\tdirectories: DirectoriesAndFiles,\n\tfiles: DirectoriesAndFiles\n) => {\n\tconst directoriesList = `${directories\n\t\t.map(\n\t\t\t(directory) =>\n\t\t\t\t`<li><a class=\"folder\" href=\"${directory.href}\">${directory.name}/</a></li>`\n\t\t)\n\t\t.join(\"\\n \")}`;\n\n\tconst filesList = `${files\n\t\t.map(\n\t\t\t(file) => `<li><a class=\"file\" href=\"${file.href}\">${file.name}</a></li>`\n\t\t)\n\t\t.join(\"\\n \")}`;\n\n\treturn `\n<!DOCTYPE html>\n<html lang=\"en\">\n <head>\n <meta content=\"text/html;charset=utf-8\" http-equiv=\"Content-Type\"/>\n <meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\">\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1, shrink-to-fit=no\">\n\n <title>Static Server Directory Listing</title>\n\n <style>\n\t\tbody {\n\t\t -webkit-font-smoothing: antialiased;\n\t\t font-family: -apple-system, Calibri, \"Helvetica Neue\", sans-serif;\n\t\t margin: 0;\n\t\t padding: 20px;\n\t\t}\n\t\tmain {\n\t\t max-width: 900px;\n\t\t}\n\t\theader {\n\t\t display: flex;\n\t\t flex-wrap: wrap;\n\t\t justify-content: space-between;\n\t\t}\n\t\th1 {\n\t\t color: #000;\n\t\t font-size: 18px;\n\t\t font-weight: bold;\n\t\t margin-top: 0;\n\t\t}\n\t\tul {\n\t\t margin: 0 0 0 -2px;\n\t\t padding: 20px 0 0 0;\n\t\t}\n\t\tul li {\n\t\t display: flex;\n\t\t font-size: 14px;\n\t\t justify-content: space-between;\n\t\t list-style: none;\n\t\t}\n\t\ta {\n\t\t text-decoration: none;\n\t\t}\n\t\tul a {\n\t\t color: #000;\n\t\t display: block;\n\t\t margin: 0 -5px;\n\t\t overflow: hidden;\n\t\t padding: 10px 5px;\n\t\t text-overflow: ellipsis;\n\t\t white-space: nowrap;\n\t\t width: 100%;\n\t\t}\n\t\tsvg {\n\t\t height: 13px;\n\t\t vertical-align: text-bottom;\n\t\t}\n\t\tul a::before {\n\t\t display: inline-block;\n\t\t vertical-align: middle;\n\t\t margin-right: 10px;\n\t\t width: 24px;\n\t\t text-align: center;\n\t\t line-height: 12px;\n\t\t}\n\t\tul a.file::before {\n\t\t content: url(\"data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='20' height='20' fill='currentColor' viewBox='0 0 16 16'> <path d='M14 4.5V14a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V2a2 2 0 0 1 2-2h5.5L14 4.5zm-3 0A1.5 1.5 0 0 1 9.5 3V1H4a1 1 0 0 0-1 1v12a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1V4.5h-2z'/> </svg>\");\n\t\t}\n\t\tul a:hover {\n\t\t text-decoration: underline;\n\t\t}\n\t\t/* folder-icon */\n\t\tul a.folder::before {\n\t\t content: url(\"data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='22' height='22' fill='currentColor' viewBox='0 0 16 16'> <path d='M9.828 3h3.982a2 2 0 0 1 1.992 2.181l-.637 7A2 2 0 0 1 13.174 14H2.825a2 2 0 0 1-1.991-1.819l-.637-7a1.99 1.99 0 0 1 .342-1.31L.5 3a2 2 0 0 1 2-2h3.672a2 2 0 0 1 1.414.586l.828.828A2 2 0 0 0 9.828 3zm-8.322.12C1.72 3.042 1.95 3 2.19 3h5.396l-.707-.707A1 1 0 0 0 6.172 2H2.5a1 1 0 0 0-1 .981l.006.139z'/> </svg>\");\n\t\t}\n\t\t::selection {\n\t\t background-color: #fff;\n\t\t color: #000;\n\t\t}\n\t\t@media (min-width: 768px) {\n\t\t ul {\n\t\t\t display: flex;\n\t\t\t flex-wrap: wrap;\n\t\t }\n\t\t ul li {\n\t\t\t width: 230px;\n\t\t\t padding-right: 20px;\n\t\t }\n\t\t}\n\t</style>\n </head>\n\n <body>\n <main>\n <header>\n <h1>\n Static Server Directory Listing\n </h1>\n </header>\n\n\n <ul id=\"files\">\n ${directoriesList}\n ${filesList}\n </ul>\n\n\t</main>\n </body>\n</html>\n`;\n};\n"],"names":["renderDirectories","directories","files","directoriesList","map","directory","href","name","join","filesList","file"],"mappings":"AAEA,OAAO,MAAMA,oBAAoB,CAChCC,aACAC
|
|
1
|
+
{"version":3,"sources":["../src/directories.ts"],"sourcesContent":["type DirectoriesAndFiles = { href: string; name: string }[];\n\nexport const renderDirectories = (\n\tdirectories: DirectoriesAndFiles,\n\tfiles: DirectoriesAndFiles\n) => {\n\tconst directoriesList = `${directories\n\t\t.map(\n\t\t\t(directory) =>\n\t\t\t\t`<li><a class=\"folder\" href=\"${directory.href}\">${directory.name}/</a></li>`\n\t\t)\n\t\t.join(\"\\n \")}`;\n\n\tconst filesList = `${files\n\t\t.map(\n\t\t\t(file) => `<li><a class=\"file\" href=\"${file.href}\">${file.name}</a></li>`\n\t\t)\n\t\t.join(\"\\n \")}`;\n\n\treturn `\n<!DOCTYPE html>\n<html lang=\"en\">\n <head>\n <meta content=\"text/html;charset=utf-8\" http-equiv=\"Content-Type\"/>\n <meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\">\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1, shrink-to-fit=no\">\n\n <title>Static Server Directory Listing</title>\n\n <style>\n\t\tbody {\n\t\t -webkit-font-smoothing: antialiased;\n\t\t font-family: -apple-system, Calibri, \"Helvetica Neue\", sans-serif;\n\t\t margin: 0;\n\t\t padding: 20px;\n\t\t}\n\t\tmain {\n\t\t max-width: 900px;\n\t\t}\n\t\theader {\n\t\t display: flex;\n\t\t flex-wrap: wrap;\n\t\t justify-content: space-between;\n\t\t}\n\t\th1 {\n\t\t color: #000;\n\t\t font-size: 18px;\n\t\t font-weight: bold;\n\t\t margin-top: 0;\n\t\t}\n\t\tul {\n\t\t margin: 0 0 0 -2px;\n\t\t padding: 20px 0 0 0;\n\t\t}\n\t\tul li {\n\t\t display: flex;\n\t\t font-size: 14px;\n\t\t justify-content: space-between;\n\t\t list-style: none;\n\t\t}\n\t\ta {\n\t\t text-decoration: none;\n\t\t}\n\t\tul a {\n\t\t color: #000;\n\t\t display: block;\n\t\t margin: 0 -5px;\n\t\t overflow: hidden;\n\t\t padding: 10px 5px;\n\t\t text-overflow: ellipsis;\n\t\t white-space: nowrap;\n\t\t width: 100%;\n\t\t}\n\t\tsvg {\n\t\t height: 13px;\n\t\t vertical-align: text-bottom;\n\t\t}\n\t\tul a::before {\n\t\t display: inline-block;\n\t\t vertical-align: middle;\n\t\t margin-right: 10px;\n\t\t width: 24px;\n\t\t text-align: center;\n\t\t line-height: 12px;\n\t\t}\n\t\tul a.file::before {\n\t\t content: url(\"data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='20' height='20' fill='currentColor' viewBox='0 0 16 16'> <path d='M14 4.5V14a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V2a2 2 0 0 1 2-2h5.5L14 4.5zm-3 0A1.5 1.5 0 0 1 9.5 3V1H4a1 1 0 0 0-1 1v12a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1V4.5h-2z'/> </svg>\");\n\t\t}\n\t\tul a:hover {\n\t\t text-decoration: underline;\n\t\t}\n\t\t/* folder-icon */\n\t\tul a.folder::before {\n\t\t content: url(\"data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='22' height='22' fill='currentColor' viewBox='0 0 16 16'> <path d='M9.828 3h3.982a2 2 0 0 1 1.992 2.181l-.637 7A2 2 0 0 1 13.174 14H2.825a2 2 0 0 1-1.991-1.819l-.637-7a1.99 1.99 0 0 1 .342-1.31L.5 3a2 2 0 0 1 2-2h3.672a2 2 0 0 1 1.414.586l.828.828A2 2 0 0 0 9.828 3zm-8.322.12C1.72 3.042 1.95 3 2.19 3h5.396l-.707-.707A1 1 0 0 0 6.172 2H2.5a1 1 0 0 0-1 .981l.006.139z'/> </svg>\");\n\t\t}\n\t\t::selection {\n\t\t background-color: #fff;\n\t\t color: #000;\n\t\t}\n\t\t@media (min-width: 768px) {\n\t\t ul {\n\t\t\t display: flex;\n\t\t\t flex-wrap: wrap;\n\t\t }\n\t\t ul li {\n\t\t\t width: 230px;\n\t\t\t padding-right: 20px;\n\t\t }\n\t\t}\n\t</style>\n </head>\n\n <body>\n <main>\n <header>\n <h1>\n Static Server Directory Listing\n </h1>\n </header>\n\n\n <ul id=\"files\">\n ${directoriesList}\n ${filesList}\n </ul>\n\n\t</main>\n </body>\n</html>\n`;\n};\n"],"names":["renderDirectories","directories","files","directoriesList","map","directory","href","name","join","filesList","file"],"mappings":"AAEA,OAAO,MAAMA,oBAAoB,CAChCC,aACAC;IAEA,MAAMC,kBAAkB,CAAC,EAAEF,YACzBG,IACA,CAACC,YACA,CAAC,4BAA4B,EAAEA,UAAUC,KAAK,EAAE,EAAED,UAAUE,KAAK,UAAU,CAAC,EAE7EC,KAAK,QAAQ,CAAC;IAEhB,MAAMC,YAAY,CAAC,EAAEP,MACnBE,IACA,CAACM,OAAS,CAAC,0BAA0B,EAAEA,KAAKJ,KAAK,EAAE,EAAEI,KAAKH,KAAK,SAAS,CAAC,EAEzEC,KAAK,QAAQ,CAAC;IAEhB,OAAO,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QAuGD,EAAEL,gBAAgB;QAClB,EAAEM,UAAU;;;;;;AAMpB,CAAC;AACD,EAAE"}
|
package/dist/index.d.ts
CHANGED
package/dist/logs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/logs.ts"],"sourcesContent":["import type { FastifyPluginAsync } from \"fastify\";\nimport fastifyPlugin from \"fastify-plugin\";\nimport kleur from \"kleur\";\n\nconst plugin: FastifyPluginAsync = async (fastify): Promise<void> => {\n\tfastify.addHook(\"onResponse\", async (request, reply) => {\n\t\trequest.log.info(\n\t\t\tkleur.cyan(`${request.method} ${request.url} ${reply.statusCode}`)\n\t\t);\n\t});\n};\n\nexport default fastifyPlugin(plugin, {\n\tfastify: \"4.x\",\n\tname: \"fastify-simple-logger\",\n});\n"],"names":["fastifyPlugin","kleur","plugin","fastify","addHook","request","reply","log","info","cyan","method","url","statusCode","name"],"mappings":"AACA,OAAOA,mBAAmB,iBAAiB;AAC3C,OAAOC,WAAW,QAAQ;AAE1B,MAAMC,SAA6B,OAAOC
|
|
1
|
+
{"version":3,"sources":["../src/logs.ts"],"sourcesContent":["import type { FastifyPluginAsync } from \"fastify\";\nimport fastifyPlugin from \"fastify-plugin\";\nimport kleur from \"kleur\";\n\nconst plugin: FastifyPluginAsync = async (fastify): Promise<void> => {\n\tfastify.addHook(\"onResponse\", async (request, reply) => {\n\t\trequest.log.info(\n\t\t\tkleur.cyan(`${request.method} ${request.url} ${reply.statusCode}`)\n\t\t);\n\t});\n};\n\nexport default fastifyPlugin(plugin, {\n\tfastify: \"4.x\",\n\tname: \"fastify-simple-logger\",\n});\n"],"names":["fastifyPlugin","kleur","plugin","fastify","addHook","request","reply","log","info","cyan","method","url","statusCode","name"],"mappings":"AACA,OAAOA,mBAAmB,iBAAiB;AAC3C,OAAOC,WAAW,QAAQ;AAE1B,MAAMC,SAA6B,OAAOC;IACzCA,QAAQC,QAAQ,cAAc,OAAOC,SAASC;QAC7CD,QAAQE,IAAIC,KACXP,MAAMQ,KAAK,CAAC,EAAEJ,QAAQK,OAAO,CAAC,EAAEL,QAAQM,IAAI,CAAC,EAAEL,MAAMM,WAAW,CAAC;IAEnE;AACD;AAEA,eAAeZ,cAAcE,QAAQ;IACpCC,SAAS;IACTU,MAAM;AACP,GAAG"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const renderNotFound: () => string;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
export const renderNotFound = ()=>{
|
|
2
|
+
return `
|
|
3
|
+
<!DOCTYPE html>
|
|
4
|
+
<html lang="en">
|
|
5
|
+
<head>
|
|
6
|
+
<meta content="text/html;charset=utf-8" http-equiv="Content-Type"/>
|
|
7
|
+
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
|
8
|
+
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
|
9
|
+
|
|
10
|
+
<title>Static Server Directory Listing</title>
|
|
11
|
+
|
|
12
|
+
<style>
|
|
13
|
+
body {
|
|
14
|
+
-webkit-font-smoothing: antialiased;
|
|
15
|
+
font-family: -apple-system, Calibri, "Helvetica Neue", sans-serif;
|
|
16
|
+
margin: 0;
|
|
17
|
+
padding: 20px;
|
|
18
|
+
}
|
|
19
|
+
main {
|
|
20
|
+
max-width: 900px;
|
|
21
|
+
}
|
|
22
|
+
header {
|
|
23
|
+
display: flex;
|
|
24
|
+
flex-wrap: wrap;
|
|
25
|
+
justify-content: space-between;
|
|
26
|
+
}
|
|
27
|
+
h1 {
|
|
28
|
+
color: #000;
|
|
29
|
+
font-size: 18px;
|
|
30
|
+
font-weight: bold;
|
|
31
|
+
margin-top: 0;
|
|
32
|
+
}
|
|
33
|
+
code {
|
|
34
|
+
font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace;
|
|
35
|
+
font-size: 13px;
|
|
36
|
+
background-color: #f7f7f7;
|
|
37
|
+
padding: 2px 4px;
|
|
38
|
+
border-radius: 3px;
|
|
39
|
+
}
|
|
40
|
+
</style>
|
|
41
|
+
</head>
|
|
42
|
+
|
|
43
|
+
<body>
|
|
44
|
+
<header>
|
|
45
|
+
<h1>
|
|
46
|
+
No "index" file found and directory listing is disabled.
|
|
47
|
+
</h1>
|
|
48
|
+
</header>
|
|
49
|
+
<main>
|
|
50
|
+
<p>Hint: use the option <code>--dirs</code> to enable directory listing.</p>
|
|
51
|
+
</main>
|
|
52
|
+
</body>
|
|
53
|
+
</html>
|
|
54
|
+
`;
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
//# sourceMappingURL=not-found.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/not-found.ts"],"sourcesContent":["export const renderNotFound = () => {\n\treturn `\n<!DOCTYPE html>\n<html lang=\"en\">\n <head>\n <meta content=\"text/html;charset=utf-8\" http-equiv=\"Content-Type\"/>\n <meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\">\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1, shrink-to-fit=no\">\n\n <title>Static Server Directory Listing</title>\n\n <style>\n body {\n -webkit-font-smoothing: antialiased;\n font-family: -apple-system, Calibri, \"Helvetica Neue\", sans-serif;\n margin: 0;\n padding: 20px;\n }\n main {\n max-width: 900px;\n }\n header {\n display: flex;\n flex-wrap: wrap;\n justify-content: space-between;\n }\n h1 {\n color: #000;\n font-size: 18px;\n font-weight: bold;\n margin-top: 0;\n }\n code {\n font-family: \"SFMono-Regular\", Consolas, \"Liberation Mono\", Menlo, Courier, monospace;\n font-size: 13px;\n background-color: #f7f7f7;\n padding: 2px 4px;\n border-radius: 3px;\n }\n </style>\n </head>\n\n <body>\n <header>\n <h1>\n No \"index\" file found and directory listing is disabled.\n </h1>\n </header>\n <main>\n <p>Hint: use the option <code>--dirs</code> to enable directory listing.</p>\n\t </main>\n </body>\n</html>\n`;\n};\n"],"names":["renderNotFound"],"mappings":"AAAA,OAAO,MAAMA,iBAAiB;IAC7B,OAAO,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoDT,CAAC;AACD,EAAE"}
|
package/dist/parse.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/parse.ts"],"sourcesContent":["import { defaultFlags, defaultParameters } from \"./defaults.js\";\n\nimport { parser } from \"@node-cli/parser\";\n\nexport type Flags = {\n\tcache?: number;\n\tcors?: boolean;\n\tdirs?: boolean;\n\tgzip?: boolean;\n\thttp2?: boolean;\n\tlogs?: boolean;\n\topen?: boolean;\n\tport?: number;\n};\n\nexport type Parameters = {\n\tpath?: string;\n};\n\nexport type Configuration = {\n\tflags?: Flags;\n\tparameters?: Parameters;\n\tusage?: boolean;\n\texamples?: string;\n};\n\nexport const config: Configuration = parser({\n\tflags: {\n\t\tcache: {\n\t\t\tshortFlag: \"c\",\n\t\t\tdefault: defaultFlags.cache,\n\t\t\tdescription: \"Time in seconds for caching files\",\n\t\t\ttype: \"number\",\n\t\t},\n\t\tcors: {\n\t\t\tshortFlag: \"C\",\n\t\t\tdefault: defaultFlags.cors,\n\t\t\tdescription: \"Set CORS headers to * to allow requests from any origin\",\n\t\t\ttype: \"boolean\",\n\t\t},\n\t\tdirs: {\n\t\t\tshortFlag: \"d\",\n\t\t\tdefault: defaultFlags.dirs,\n\t\t\tdescription: \"List the directory's contents\",\n\t\t\ttype: \"boolean\",\n\t\t},\n\t\tgzip: {\n\t\t\tshortFlag: \"g\",\n\t\t\tdefault: defaultFlags.gzip,\n\t\t\tdescription: \"Enable GZIP compression\",\n\t\t\ttype: \"boolean\",\n\t\t},\n\t\thelp: {\n\t\t\tshortFlag: \"h\",\n\t\t\tdescription: \"Display help instructions\",\n\t\t\ttype: \"boolean\",\n\t\t},\n\t\thttp2: {\n\t\t\tshortFlag: \"H\",\n\t\t\tdefault: defaultFlags.http2,\n\t\t\tdescription: \"Set HTTP to version 2\",\n\t\t\ttype: \"boolean\",\n\t\t},\n\t\tlogs: {\n\t\t\tshortFlag: \"l\",\n\t\t\tdefault: defaultFlags.logs,\n\t\t\tdescription: \"Log HTTP requests at the prompt\",\n\t\t\ttype: \"boolean\",\n\t\t},\n\t\topen: {\n\t\t\tshortFlag: \"o\",\n\t\t\tdefault: defaultFlags.open,\n\t\t\tdescription: \"Open in your default browser\",\n\t\t\ttype: \"boolean\",\n\t\t},\n\t\tport: {\n\t\t\tshortFlag: \"p\",\n\t\t\tdefault: defaultFlags.port,\n\t\t\tdescription: \"Port to listen on\",\n\t\t\ttype: \"number\",\n\t\t},\n\t\tversion: {\n\t\t\tshortFlag: \"v\",\n\t\t\tdescription: \"Output the current version\",\n\t\t\ttype: \"boolean\",\n\t\t},\n\t},\n\tparameters: {\n\t\tpath: {\n\t\t\tdefault: \"current folder\",\n\t\t\tdescription: \"the path to serve files from\",\n\t\t},\n\t},\n\tusage: true,\n\tdefaultFlags,\n\tdefaultParameters,\n});\n"],"names":["defaultFlags","defaultParameters","parser","config","flags","cache","shortFlag","default","description","type","cors","dirs","gzip","help","http2","logs","open","port","version","parameters","path","usage"],"mappings":"AAAA,SAASA,YAAY,EAAEC,iBAAiB,QAAQ,gBAAgB;AAEhE,SAASC,MAAM,QAAQ,mBAAmB;AAwB1C,OAAO,MAAMC,SAAwBD,OAAO;IAC3CE,OAAO;QACNC,OAAO;YACNC,WAAW;YACXC,SAASP,aAAaK
|
|
1
|
+
{"version":3,"sources":["../src/parse.ts"],"sourcesContent":["import { defaultFlags, defaultParameters } from \"./defaults.js\";\n\nimport { parser } from \"@node-cli/parser\";\n\nexport type Flags = {\n\tcache?: number;\n\tcors?: boolean;\n\tdirs?: boolean;\n\tgzip?: boolean;\n\thttp2?: boolean;\n\tlogs?: boolean;\n\topen?: boolean;\n\tport?: number;\n};\n\nexport type Parameters = {\n\tpath?: string;\n};\n\nexport type Configuration = {\n\tflags?: Flags;\n\tparameters?: Parameters;\n\tusage?: boolean;\n\texamples?: string;\n};\n\nexport const config: Configuration = parser({\n\tflags: {\n\t\tcache: {\n\t\t\tshortFlag: \"c\",\n\t\t\tdefault: defaultFlags.cache,\n\t\t\tdescription: \"Time in seconds for caching files\",\n\t\t\ttype: \"number\",\n\t\t},\n\t\tcors: {\n\t\t\tshortFlag: \"C\",\n\t\t\tdefault: defaultFlags.cors,\n\t\t\tdescription: \"Set CORS headers to * to allow requests from any origin\",\n\t\t\ttype: \"boolean\",\n\t\t},\n\t\tdirs: {\n\t\t\tshortFlag: \"d\",\n\t\t\tdefault: defaultFlags.dirs,\n\t\t\tdescription: \"List the directory's contents\",\n\t\t\ttype: \"boolean\",\n\t\t},\n\t\tgzip: {\n\t\t\tshortFlag: \"g\",\n\t\t\tdefault: defaultFlags.gzip,\n\t\t\tdescription: \"Enable GZIP compression\",\n\t\t\ttype: \"boolean\",\n\t\t},\n\t\thelp: {\n\t\t\tshortFlag: \"h\",\n\t\t\tdescription: \"Display help instructions\",\n\t\t\ttype: \"boolean\",\n\t\t},\n\t\thttp2: {\n\t\t\tshortFlag: \"H\",\n\t\t\tdefault: defaultFlags.http2,\n\t\t\tdescription: \"Set HTTP to version 2\",\n\t\t\ttype: \"boolean\",\n\t\t},\n\t\tlogs: {\n\t\t\tshortFlag: \"l\",\n\t\t\tdefault: defaultFlags.logs,\n\t\t\tdescription: \"Log HTTP requests at the prompt\",\n\t\t\ttype: \"boolean\",\n\t\t},\n\t\topen: {\n\t\t\tshortFlag: \"o\",\n\t\t\tdefault: defaultFlags.open,\n\t\t\tdescription: \"Open in your default browser\",\n\t\t\ttype: \"boolean\",\n\t\t},\n\t\tport: {\n\t\t\tshortFlag: \"p\",\n\t\t\tdefault: defaultFlags.port,\n\t\t\tdescription: \"Port to listen on\",\n\t\t\ttype: \"number\",\n\t\t},\n\t\tversion: {\n\t\t\tshortFlag: \"v\",\n\t\t\tdescription: \"Output the current version\",\n\t\t\ttype: \"boolean\",\n\t\t},\n\t},\n\tparameters: {\n\t\tpath: {\n\t\t\tdefault: \"current folder\",\n\t\t\tdescription: \"the path to serve files from\",\n\t\t},\n\t},\n\tusage: true,\n\tdefaultFlags,\n\tdefaultParameters,\n});\n"],"names":["defaultFlags","defaultParameters","parser","config","flags","cache","shortFlag","default","description","type","cors","dirs","gzip","help","http2","logs","open","port","version","parameters","path","usage"],"mappings":"AAAA,SAASA,YAAY,EAAEC,iBAAiB,QAAQ,gBAAgB;AAEhE,SAASC,MAAM,QAAQ,mBAAmB;AAwB1C,OAAO,MAAMC,SAAwBD,OAAO;IAC3CE,OAAO;QACNC,OAAO;YACNC,WAAW;YACXC,SAASP,aAAaK;YACtBG,aAAa;YACbC,MAAM;QACP;QACAC,MAAM;YACLJ,WAAW;YACXC,SAASP,aAAaU;YACtBF,aAAa;YACbC,MAAM;QACP;QACAE,MAAM;YACLL,WAAW;YACXC,SAASP,aAAaW;YACtBH,aAAa;YACbC,MAAM;QACP;QACAG,MAAM;YACLN,WAAW;YACXC,SAASP,aAAaY;YACtBJ,aAAa;YACbC,MAAM;QACP;QACAI,MAAM;YACLP,WAAW;YACXE,aAAa;YACbC,MAAM;QACP;QACAK,OAAO;YACNR,WAAW;YACXC,SAASP,aAAac;YACtBN,aAAa;YACbC,MAAM;QACP;QACAM,MAAM;YACLT,WAAW;YACXC,SAASP,aAAae;YACtBP,aAAa;YACbC,MAAM;QACP;QACAO,MAAM;YACLV,WAAW;YACXC,SAASP,aAAagB;YACtBR,aAAa;YACbC,MAAM;QACP;QACAQ,MAAM;YACLX,WAAW;YACXC,SAASP,aAAaiB;YACtBT,aAAa;YACbC,MAAM;QACP;QACAS,SAAS;YACRZ,WAAW;YACXE,aAAa;YACbC,MAAM;QACP;IACD;IACAU,YAAY;QACXC,MAAM;YACLb,SAAS;YACTC,aAAa;QACd;IACD;IACAa,OAAO;IACPrB;IACAC;AACD,GAAG"}
|
package/dist/server.js
CHANGED
|
@@ -3,7 +3,6 @@ import { cert, key } from "./certs.js";
|
|
|
3
3
|
import fastifyStatic from "@fastify/static";
|
|
4
4
|
import Fastify from "fastify";
|
|
5
5
|
import { Logger } from "@node-cli/logger";
|
|
6
|
-
import boxen from "boxen";
|
|
7
6
|
import { config } from "./parse.js";
|
|
8
7
|
import fastifyCache from "@fastify/caching";
|
|
9
8
|
import fastifyCompress from "@fastify/compress";
|
|
@@ -15,6 +14,7 @@ import open from "open";
|
|
|
15
14
|
import path from "node:path";
|
|
16
15
|
import portfinder from "portfinder";
|
|
17
16
|
import { renderDirectories } from "./directories.js";
|
|
17
|
+
import { renderNotFound } from "./not-found.js";
|
|
18
18
|
export const logger = new Logger({
|
|
19
19
|
boring: process.env.NODE_ENV === "test"
|
|
20
20
|
});
|
|
@@ -87,6 +87,9 @@ if (config.flags.dirs) {
|
|
|
87
87
|
};
|
|
88
88
|
}
|
|
89
89
|
fastify.register(fastifyStatic, staticOptions);
|
|
90
|
+
fastify.setNotFoundHandler((request, reply)=>{
|
|
91
|
+
reply.code(404).type("text/html").send(renderNotFound());
|
|
92
|
+
});
|
|
90
93
|
/**
|
|
91
94
|
* Run the server!
|
|
92
95
|
*/ let port, portMessage = "";
|
|
@@ -110,12 +113,9 @@ const start = async ()=>{
|
|
|
110
113
|
"",
|
|
111
114
|
`Hit CTRL+C to shut it down.${portMessage}`
|
|
112
115
|
];
|
|
113
|
-
logger.
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
borderColor: "yellow",
|
|
117
|
-
padding: 1
|
|
118
|
-
}));
|
|
116
|
+
logger.printBox(messages, {
|
|
117
|
+
newLineAfter: false
|
|
118
|
+
});
|
|
119
119
|
if (config.flags.open) {
|
|
120
120
|
await open(url, {
|
|
121
121
|
wait: false
|
package/dist/server.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/server.ts"],"sourcesContent":["#!/usr/bin/env node\n\nimport { cert, key } from \"./certs.js\";\nimport fastifyStatic, { FastifyStaticOptions } from \"@fastify/static\";\n\nimport Fastify from \"fastify\";\nimport { Logger } from \"@node-cli/logger\";\nimport
|
|
1
|
+
{"version":3,"sources":["../src/server.ts"],"sourcesContent":["#!/usr/bin/env node\n\nimport { cert, key } from \"./certs.js\";\nimport fastifyStatic, { FastifyStaticOptions } from \"@fastify/static\";\n\nimport Fastify from \"fastify\";\nimport { Logger } from \"@node-cli/logger\";\nimport { config } from \"./parse.js\";\nimport fastifyCache from \"@fastify/caching\";\nimport fastifyCompress from \"@fastify/compress\";\nimport fastifyCors from \"@fastify/cors\";\nimport fastifyLogs from \"./logs.js\";\nimport fs from \"fs-extra\";\nimport kleur from \"kleur\";\nimport open from \"open\";\nimport path from \"node:path\";\nimport portfinder from \"portfinder\";\nimport { renderDirectories } from \"./directories.js\";\nimport { renderNotFound } from \"./not-found.js\";\n\nexport const logger = new Logger({\n\tboring: process.env.NODE_ENV === \"test\",\n});\n\nlet customPath = config.parameters[0];\nif (fs.pathExistsSync(customPath)) {\n\tcustomPath = path.resolve(customPath);\n} else {\n\tlogger.printErrorsAndExit([`Folder ${customPath} does not exist!`], 0);\n}\n\nconst fastifyOptions: {\n\tdisableRequestLogging?: boolean;\n\thttp2?: boolean;\n\thttps?: any;\n\tlogger?: any;\n} = {\n\tdisableRequestLogging: true,\n};\n\nif (config.flags.logs) {\n\tfastifyOptions.logger = {\n\t\tlevel: \"info\",\n\t\ttransport: {\n\t\t\ttarget: \"pino-pretty\",\n\t\t\toptions: {\n\t\t\t\thideObject: true,\n\t\t\t\ttranslateTime: \"SYS:standard\",\n\t\t\t\tignore: \"pid,hostname,reqId,resTime,resTimeMs,level\",\n\t\t\t},\n\t\t},\n\t};\n}\n\nif (config.flags.http2) {\n\tfastifyOptions.http2 = true;\n\tfastifyOptions.https = { key, cert };\n}\n\nconst fastify = Fastify(fastifyOptions);\n\nif (config.flags.logs) {\n\tfastify.register(fastifyLogs);\n}\n\nif (config.flags.gzip) {\n\tfastify.register(fastifyCompress, {\n\t\tglobal: true,\n\t\tencodings: [\"gzip\", \"deflate\", \"br\", \"identity\"],\n\t});\n}\n\nif (config.flags.cors) {\n\tfastify.register(fastifyCors);\n}\n\nconst fastifyCacheOptions: {\n\texpiresIn?: number;\n\tserverExpiresIn?: number;\n\tprivacy?: any;\n} = {};\n\nif (config.flags.cache > 0) {\n\tfastifyCacheOptions.expiresIn = config.flags.cache;\n\tfastifyCacheOptions.serverExpiresIn = config.flags.cache;\n\tfastifyCacheOptions.privacy = \"public\";\n} else {\n\tfastifyCacheOptions.privacy = \"no-cache\";\n}\n\nfastify.register(fastifyCache, fastifyCacheOptions);\n\nconst staticOptions: FastifyStaticOptions = {\n\troot: customPath,\n};\nif (config.flags.dirs) {\n\tstaticOptions.index = false;\n\tstaticOptions.list = {\n\t\tformat: \"html\",\n\t\trender: renderDirectories,\n\t};\n}\nfastify.register(fastifyStatic, staticOptions);\n\nfastify.setNotFoundHandler((request, reply) => {\n\treply.code(404).type(\"text/html\").send(renderNotFound());\n});\n\n/**\n * Run the server!\n */\nlet port: number,\n\tportMessage = \"\";\nconst start = async () => {\n\ttry {\n\t\tport = await portfinder.getPortPromise({ port: Number(config.flags.port) });\n\t\tif (port !== config.flags.port) {\n\t\t\tportMessage = `\\n\\n${kleur.yellow(\n\t\t\t\t`Warning: port ${config.flags.port} was not available!`\n\t\t\t)}`;\n\t\t\tconfig.flags.port = port;\n\t\t}\n\t\tawait fastify.listen({ port: config.flags.port });\n\n\t\tconst url = `${config.flags.http2 ? \"https\" : \"http\"}://localhost:${\n\t\t\tconfig.flags.port\n\t\t}`;\n\t\tconst messages = [\n\t\t\t`${kleur.cyan(\"Static Server\")} is up and running!`,\n\t\t\t\"\",\n\t\t\t`${kleur.cyan(url)}`,\n\t\t\t\"\",\n\t\t\t`Hit CTRL+C to shut it down.${portMessage}`,\n\t\t];\n\n\t\tlogger.printBox(messages, { newLineAfter: false });\n\n\t\tif (config.flags.open) {\n\t\t\tawait open(url, {\n\t\t\t\twait: false,\n\t\t\t});\n\t\t}\n\t} catch (error) {\n\t\tfastify.log.error(error);\n\t\t// eslint-disable-next-line unicorn/no-process-exit\n\t\tprocess.exit(1);\n\t}\n};\nstart();\n"],"names":["cert","key","fastifyStatic","Fastify","Logger","config","fastifyCache","fastifyCompress","fastifyCors","fastifyLogs","fs","kleur","open","path","portfinder","renderDirectories","renderNotFound","logger","boring","process","env","NODE_ENV","customPath","parameters","pathExistsSync","resolve","printErrorsAndExit","fastifyOptions","disableRequestLogging","flags","logs","level","transport","target","options","hideObject","translateTime","ignore","http2","https","fastify","register","gzip","global","encodings","cors","fastifyCacheOptions","cache","expiresIn","serverExpiresIn","privacy","staticOptions","root","dirs","index","list","format","render","setNotFoundHandler","request","reply","code","type","send","port","portMessage","start","getPortPromise","Number","yellow","listen","url","messages","cyan","printBox","newLineAfter","wait","error","log","exit"],"mappings":"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"}
|
package/dist/utilities.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/utilities.ts"],"sourcesContent":["import _ from \"lodash\";\n\n/**\n * Wrapper method for lodash `merge()` and `mergeWith()` methods.\n *\n * Without the `customizer` function, this method recursively merges own and inherited\n * enumerable string keyed properties of source objects into the destination object.\n * Source properties that resolve to undefined are skipped if a destination value exists.\n * Array and plain object properties are merged recursively. Other objects and value\n * types are overridden by assignment. Source objects are applied from left to right.\n * Subsequent sources overwrite property assignments of previous sources.\n *\n * With the `customizer` function, the behavior is the same except that `customizer` is\n * invoked to produce the merged values of the destination and source properties.\n * If customizer returns undefined, merging is handled by the `shallowMerge` instead.\n * The customizer is invoked with six arguments: `(objValue, srcValue, key, object,\n * source, stack)`\n * @param {object} objA\n * @param {object} objB\n * @param {function} customizer\n * @returns {object}\n *\n * !! WARNING: this method will mutate objA\n */\nexport const shallowMerge = (\n\tobjectA: any,\n\tobjectB: any,\n\tcustomizer?: any\n): object => {\n\treturn typeof customizer === \"function\"\n\t\t? _.mergeWith(objectA, objectB, customizer)\n\t\t: _.merge(objectA, objectB);\n};\n"],"names":["_","shallowMerge","objectA","objectB","customizer","mergeWith","merge"],"mappings":"AAAA,OAAOA,OAAO,SAAS;AAEvB;;;;;;;;;;;;;;;;;;;;;CAqBC,GACD,OAAO,MAAMC,eAAe,CAC3BC,SACAC,SACAC
|
|
1
|
+
{"version":3,"sources":["../src/utilities.ts"],"sourcesContent":["import _ from \"lodash\";\n\n/**\n * Wrapper method for lodash `merge()` and `mergeWith()` methods.\n *\n * Without the `customizer` function, this method recursively merges own and inherited\n * enumerable string keyed properties of source objects into the destination object.\n * Source properties that resolve to undefined are skipped if a destination value exists.\n * Array and plain object properties are merged recursively. Other objects and value\n * types are overridden by assignment. Source objects are applied from left to right.\n * Subsequent sources overwrite property assignments of previous sources.\n *\n * With the `customizer` function, the behavior is the same except that `customizer` is\n * invoked to produce the merged values of the destination and source properties.\n * If customizer returns undefined, merging is handled by the `shallowMerge` instead.\n * The customizer is invoked with six arguments: `(objValue, srcValue, key, object,\n * source, stack)`\n * @param {object} objA\n * @param {object} objB\n * @param {function} customizer\n * @returns {object}\n *\n * !! WARNING: this method will mutate objA\n */\nexport const shallowMerge = (\n\tobjectA: any,\n\tobjectB: any,\n\tcustomizer?: any\n): object => {\n\treturn typeof customizer === \"function\"\n\t\t? _.mergeWith(objectA, objectB, customizer)\n\t\t: _.merge(objectA, objectB);\n};\n"],"names":["_","shallowMerge","objectA","objectB","customizer","mergeWith","merge"],"mappings":"AAAA,OAAOA,OAAO,SAAS;AAEvB;;;;;;;;;;;;;;;;;;;;;CAqBC,GACD,OAAO,MAAMC,eAAe,CAC3BC,SACAC,SACAC;IAEA,OAAO,OAAOA,eAAe,aAC1BJ,EAAEK,UAAUH,SAASC,SAASC,cAC9BJ,EAAEM,MAAMJ,SAASC;AACrB,EAAE"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@node-cli/static-server",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.2",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"author": "Arno Versini",
|
|
6
6
|
"description": "A simple, zero-configuration, command line HTTP server to serve static files locally",
|
|
@@ -20,9 +20,7 @@
|
|
|
20
20
|
"build:js": "swc --source-maps --out-dir dist src --copy-files",
|
|
21
21
|
"build:types": "tsc",
|
|
22
22
|
"clean": "rimraf dist types coverage",
|
|
23
|
-
"lint": "eslint \"src/*.ts\"",
|
|
24
|
-
"test": "jest",
|
|
25
|
-
"test:coverage": "echo 'No coverage available yet'",
|
|
23
|
+
"lint": "prettier --write \"src/*.ts\" && eslint --fix \"src/*.ts\"",
|
|
26
24
|
"watch": "swc --watch --out-dir dist src"
|
|
27
25
|
},
|
|
28
26
|
"dependencies": {
|
|
@@ -30,9 +28,8 @@
|
|
|
30
28
|
"@fastify/compress": "6.3.0",
|
|
31
29
|
"@fastify/cors": "8.2.1",
|
|
32
30
|
"@fastify/static": "6.10.1",
|
|
33
|
-
"@node-cli/logger": ">=0.0
|
|
34
|
-
"@node-cli/parser": ">=0.0
|
|
35
|
-
"boxen": "7.1.0",
|
|
31
|
+
"@node-cli/logger": ">=1.0.0",
|
|
32
|
+
"@node-cli/parser": ">=1.0.0",
|
|
36
33
|
"fastify": "4.17.0",
|
|
37
34
|
"fastify-plugin": "4.5.0",
|
|
38
35
|
"fs-extra": "11.1.1",
|
|
@@ -45,5 +42,5 @@
|
|
|
45
42
|
"publishConfig": {
|
|
46
43
|
"access": "public"
|
|
47
44
|
},
|
|
48
|
-
"gitHead": "
|
|
45
|
+
"gitHead": "fbb0503a2d56b1bf16208b74926e3d7d4a487cc4"
|
|
49
46
|
}
|