@node-cli/static-server 1.1.1 → 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/index.d.ts CHANGED
@@ -6,6 +6,7 @@ export * from "./certs";
6
6
  export * from "./defaults";
7
7
  export * from "./directories";
8
8
  export * from "./logs";
9
+ export * from "./not-found";
9
10
  export * from "./parse";
10
11
  export * from "./server";
11
12
  export * from "./utilities";
@@ -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/server.js CHANGED
@@ -14,6 +14,7 @@ import open from "open";
14
14
  import path from "node:path";
15
15
  import portfinder from "portfinder";
16
16
  import { renderDirectories } from "./directories.js";
17
+ import { renderNotFound } from "./not-found.js";
17
18
  export const logger = new Logger({
18
19
  boring: process.env.NODE_ENV === "test"
19
20
  });
@@ -86,6 +87,9 @@ if (config.flags.dirs) {
86
87
  };
87
88
  }
88
89
  fastify.register(fastifyStatic, staticOptions);
90
+ fastify.setNotFoundHandler((request, reply)=>{
91
+ reply.code(404).type("text/html").send(renderNotFound());
92
+ });
89
93
  /**
90
94
  * Run the server!
91
95
  */ let port, portMessage = "";
@@ -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 { 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\";\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\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","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","port","portMessage","start","getPortPromise","Number","yellow","listen","url","messages","cyan","printBox","newLineAfter","wait","error","log","exit"],"mappings":";AAEA,SAASA,IAAI,EAAEC,GAAG,QAAQ,aAAa;AACvC,OAAOC,mBAA6C,kBAAkB;AAEtE,OAAOC,aAAa,UAAU;AAC9B,SAASC,MAAM,QAAQ,mBAAmB;AAC1C,SAASC,MAAM,QAAQ,aAAa;AACpC,OAAOC,kBAAkB,mBAAmB;AAC5C,OAAOC,qBAAqB,oBAAoB;AAChD,OAAOC,iBAAiB,gBAAgB;AACxC,OAAOC,iBAAiB,YAAY;AACpC,OAAOC,QAAQ,WAAW;AAC1B,OAAOC,WAAW,QAAQ;AAC1B,OAAOC,UAAU,OAAO;AACxB,OAAOC,UAAU,YAAY;AAC7B,OAAOC,gBAAgB,aAAa;AACpC,SAASC,iBAAiB,QAAQ,mBAAmB;AAErD,OAAO,MAAMC,SAAS,IAAIZ,OAAO;IAChCa,QAAQC,QAAQC,IAAIC,aAAa;AAClC,GAAG;AAEH,IAAIC,aAAahB,OAAOiB,UAAU,CAAC,EAAE;AACrC,IAAIZ,GAAGa,eAAeF,aAAa;IAClCA,aAAaR,KAAKW,QAAQH;AAC3B,OAAO;IACNL,OAAOS,mBAAmB;QAAC,CAAC,OAAO,EAAEJ,WAAW,gBAAgB,CAAC;KAAC,EAAE;AACrE;AAEA,MAAMK,iBAKF;IACHC,u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Ac,CAAC,IAAI,EAAE/C,MAAMmD,OAC1B,CAAC,cAAc,EAAEzD,OAAOuB,MAAM6B,KAAK,mBAAmB,CAAC,EACtD,CAAC;YACHpD,OAAOuB,MAAM6B,OAAOA;QACrB;QACA,MAAMlB,QAAQwB,OAAO;YAAEN,MAAMpD,OAAOuB,MAAM6B;QAAK;QAE/C,MAAMO,MAAM,CAAC,EAAE3D,OAAOuB,MAAMS,QAAQ,UAAU,OAAO,aAAa,EACjEhC,OAAOuB,MAAM6B,KACb,CAAC;QACF,MAAMQ,WAAW;YAChB,CAAC,EAAEtD,MAAMuD,KAAK,iBAAiB,mBAAmB,CAAC;YACnD;YACA,CAAC,EAAEvD,MAAMuD,KAAKF,KAAK,CAAC;YACpB;YACA,CAAC,2BAA2B,EAAEN,YAAY,CAAC;SAC3C;QAED1C,OAAOmD,SAASF,UAAU;YAAEG,cAAc;QAAM;QAEhD,IAAI/D,OAAOuB,MAAMhB,MAAM;YACtB,MAAMA,KAAKoD,KAAK;gBACfK,MAAM;YACP;QACD;IACD,EAAE,OAAOC,OAAO;QACf/B,QAAQgC,IAAID,MAAMA;QAClB,mDAAmD;QACnDpD,QAAQsD,KAAK;IACd;AACD;AACAb"}
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":";AAEA,SAASA,IAAI,EAAEC,GAAG,QA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AC,EAAE7D,MAAM8D,KAAK,iBAAiB,mBAAmB,CAAC;YACnD;YACA,CAAC,EAAE9D,MAAM8D,KAAKF,KAAK,CAAC;YACpB;YACA,CAAC,2BAA2B,EAAEN,YAAY,CAAC;SAC3C;QAEDhD,OAAOyD,SAASF,UAAU;YAAEG,cAAc;QAAM;QAEhD,IAAItE,OAAOwB,MAAMjB,MAAM;YACtB,MAAMA,KAAK2D,KAAK;gBACfK,MAAM;YACP;QACD;IACD,EAAE,OAAOC,OAAO;QACfrC,QAAQsC,IAAID,MAAMA;QAClB,mDAAmD;QACnD1D,QAAQ4D,KAAK;IACd;AACD;AACAb"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@node-cli/static-server",
3
- "version": "1.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": {
@@ -44,5 +42,5 @@
44
42
  "publishConfig": {
45
43
  "access": "public"
46
44
  },
47
- "gitHead": "d1d89854e385600edfd9c2aead7c9bc568bcc657"
45
+ "gitHead": "fbb0503a2d56b1bf16208b74926e3d7d4a487cc4"
48
46
  }