@caboodle-tech/node-simple-server 4.2.4 → 4.3.0
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/README.md +49 -38
- package/bin/nss.js +101 -68
- package/bin/print.js +0 -2
- package/changelogs/v4.md +36 -0
- package/eslint/html-rules.js +24 -0
- package/eslint/js-rules.js +143 -0
- package/eslint/json-rules.js +21 -0
- package/eslint.config.js +44 -0
- package/examples/controllers/prod-website.js +2 -3
- package/examples/controllers/website.js +2 -3
- package/examples/controllers/websocket.js +4 -10
- package/examples/www-production/js/main.js +2 -3
- package/examples/www-website/character-test.html +252 -0
- package/examples/www-website/index.html +4 -1
- package/examples/www-website/js/main.js +2 -3
- package/examples/www-websockets/js/main.js +9 -7
- package/handlers/dir-listing.html +9 -9
- package/handlers/forbidden.html +5 -5
- package/handlers/live-reloading.html +1 -1
- package/handlers/not-found.html +5 -5
- package/handlers/websocket-only.html +1 -1
- package/package.json +11 -6
- package/.eslintrc.json +0 -50
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
<html>
|
|
3
3
|
<head>
|
|
4
4
|
<!-- This is NSS's directory listing page. -->
|
|
5
|
-
<meta charset="UTF-8"
|
|
6
|
-
<meta
|
|
5
|
+
<meta charset="UTF-8">
|
|
6
|
+
<meta content="width=device-width, initial-scale=1.0" name="viewport">
|
|
7
7
|
<title>Directory Listing</title>
|
|
8
8
|
<style>
|
|
9
9
|
html,
|
|
@@ -90,7 +90,7 @@
|
|
|
90
90
|
<div class="col">
|
|
91
91
|
<h1>
|
|
92
92
|
Listing
|
|
93
|
-
<script
|
|
93
|
+
<script>
|
|
94
94
|
document.write(document.location.pathname);
|
|
95
95
|
</script>
|
|
96
96
|
</h1>
|
|
@@ -98,8 +98,8 @@
|
|
|
98
98
|
</div>
|
|
99
99
|
<div class="row content">
|
|
100
100
|
<div class="col">
|
|
101
|
-
<svg class="icon"
|
|
102
|
-
<path d="M22 24h-20v-24h14l6 6v18zm-7-23h-12v22h18v-16h-6v-6zm3 15v1h-12v-1h12zm0-3v1h-12v-1h12zm0-3v1h-12v-1h12zm-2-4h4.586l-4.586-4.586v4.586z"
|
|
101
|
+
<svg class="icon" clip-rule="evenodd" fill-rule="evenodd" height="24" width="24" xmlns="http://www.w3.org/2000/svg">
|
|
102
|
+
<path d="M22 24h-20v-24h14l6 6v18zm-7-23h-12v22h18v-16h-6v-6zm3 15v1h-12v-1h12zm0-3v1h-12v-1h12zm0-3v1h-12v-1h12zm-2-4h4.586l-4.586-4.586v4.586z"/>
|
|
103
103
|
</svg>
|
|
104
104
|
<span class="title">Files</span>
|
|
105
105
|
<ul>
|
|
@@ -107,8 +107,8 @@
|
|
|
107
107
|
</ul>
|
|
108
108
|
</div>
|
|
109
109
|
<div class="col">
|
|
110
|
-
<svg class="icon"
|
|
111
|
-
<path d="M6.083 4c1.38 1.612 2.578 3 4.917 3h11v13h-20v-16h4.083zm.917-2h-7v20h24v-17h-13c-1.629 0-2.305-1.058-4-3z"
|
|
110
|
+
<svg class="icon" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg">
|
|
111
|
+
<path d="M6.083 4c1.38 1.612 2.578 3 4.917 3h11v13h-20v-16h4.083zm.917-2h-7v20h24v-17h-13c-1.629 0-2.305-1.058-4-3z"/>
|
|
112
112
|
</svg>
|
|
113
113
|
<span class="title">Directories</span>
|
|
114
114
|
<ul>
|
|
@@ -121,11 +121,11 @@
|
|
|
121
121
|
<p>
|
|
122
122
|
<i>
|
|
123
123
|
Node Simple Server (NSS) {{version}} Server
|
|
124
|
-
<script
|
|
124
|
+
<script>
|
|
125
125
|
document.write(`${document.location.protocol}//${document.location.hostname}`);
|
|
126
126
|
</script>
|
|
127
127
|
Port
|
|
128
|
-
<script
|
|
128
|
+
<script>
|
|
129
129
|
document.write(document.location.port);
|
|
130
130
|
</script>
|
|
131
131
|
</i>
|
package/handlers/forbidden.html
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
<html>
|
|
3
3
|
<head>
|
|
4
4
|
<!-- This is NSS's forbidden page. -->
|
|
5
|
-
<meta charset="UTF-8"
|
|
6
|
-
<meta
|
|
5
|
+
<meta charset="UTF-8">
|
|
6
|
+
<meta content="width=device-width, initial-scale=1.0" name="viewport">
|
|
7
7
|
<title>403 Forbidden</title>
|
|
8
8
|
<style>
|
|
9
9
|
html,
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
<h1>403 Forbidden</h1>
|
|
21
21
|
<p>
|
|
22
22
|
You don't have permission to access
|
|
23
|
-
<script
|
|
23
|
+
<script>
|
|
24
24
|
document.write(document.location.pathname);
|
|
25
25
|
</script>
|
|
26
26
|
on this server.
|
|
@@ -29,11 +29,11 @@
|
|
|
29
29
|
<p>
|
|
30
30
|
<i>
|
|
31
31
|
Node Simple Server (NSS) {{version}} Server
|
|
32
|
-
<script
|
|
32
|
+
<script>
|
|
33
33
|
document.write(`${document.location.protocol}//${document.location.hostname}`);
|
|
34
34
|
</script>
|
|
35
35
|
port
|
|
36
|
-
<script
|
|
36
|
+
<script>
|
|
37
37
|
document.write(document.location.port);
|
|
38
38
|
</script>
|
|
39
39
|
</i>
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
<style>
|
|
3
3
|
#NSS_WS{display:flex;justify-content:center;align-items:center;position:fixed;right:15px;bottom:15px;z-index:9000;width:80px;height:45px;border-radius:25px;background:#000}#NSS_WS svg{margin-left:5px;fill:#ffffff}#NSS_WS span{display:inline-block;margin-right:5px;font-family:monospace;font-size:22px;color:#fff}
|
|
4
4
|
</style>
|
|
5
|
-
<script
|
|
5
|
+
<script>
|
|
6
6
|
// <![CDATA[
|
|
7
7
|
if ('WebSocket' in window) {
|
|
8
8
|
NSS_WS = (() => {
|
package/handlers/not-found.html
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
<html>
|
|
3
3
|
<head>
|
|
4
4
|
<!-- This is NSS's 404 page. -->
|
|
5
|
-
<meta charset="UTF-8"
|
|
6
|
-
<meta
|
|
5
|
+
<meta charset="UTF-8">
|
|
6
|
+
<meta content="width=device-width, initial-scale=1.0" name="viewport">
|
|
7
7
|
<title>404 Not Found</title>
|
|
8
8
|
<style>
|
|
9
9
|
html,
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
<h1>404 Not Found</h1>
|
|
21
21
|
<p>
|
|
22
22
|
The requested URL
|
|
23
|
-
<script
|
|
23
|
+
<script>
|
|
24
24
|
document.write(document.location.pathname);
|
|
25
25
|
</script>
|
|
26
26
|
was not found on this server.
|
|
@@ -29,11 +29,11 @@
|
|
|
29
29
|
<p>
|
|
30
30
|
<i>
|
|
31
31
|
Node Simple Server (NSS) {{version}} Server
|
|
32
|
-
<script
|
|
32
|
+
<script>
|
|
33
33
|
document.write(`${document.location.protocol}//${document.location.hostname}`);
|
|
34
34
|
</script>
|
|
35
35
|
Port
|
|
36
|
-
<script
|
|
36
|
+
<script>
|
|
37
37
|
document.write(document.location.port);
|
|
38
38
|
</script>
|
|
39
39
|
</i>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@caboodle-tech/node-simple-server",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.3.0",
|
|
4
4
|
"description": "Node Simple Server (NSS): A small but effective node based server for development sites, customizable live reloading, and websocket support built-in.",
|
|
5
5
|
"main": "bin/nss.js",
|
|
6
6
|
"scripts": {
|
|
@@ -36,13 +36,18 @@
|
|
|
36
36
|
"url": "https://github.com/caboodle-tech/node-simple-server/issues"
|
|
37
37
|
},
|
|
38
38
|
"homepage": "https://github.com/caboodle-tech/node-simple-server#readme",
|
|
39
|
+
"engines": {
|
|
40
|
+
"node": ">=14.0.0"
|
|
41
|
+
},
|
|
39
42
|
"dependencies": {
|
|
40
|
-
"chokidar": "^
|
|
41
|
-
"ws": "^8.
|
|
43
|
+
"chokidar": "^5.0.0",
|
|
44
|
+
"ws": "^8.19.0"
|
|
42
45
|
},
|
|
43
46
|
"devDependencies": {
|
|
44
|
-
"eslint": "^
|
|
45
|
-
"eslint
|
|
46
|
-
"eslint
|
|
47
|
+
"@html-eslint/eslint-plugin": "^0.32.0",
|
|
48
|
+
"@html-eslint/parser": "^0.32.0",
|
|
49
|
+
"eslint": "^9.39.4",
|
|
50
|
+
"eslint-plugin-jsonc": "^2.21.1",
|
|
51
|
+
"jsonc-eslint-parser": "^2.4.2"
|
|
47
52
|
}
|
|
48
53
|
}
|
package/.eslintrc.json
DELETED
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"env": {
|
|
3
|
-
"browser": true,
|
|
4
|
-
"commonjs": true,
|
|
5
|
-
"es2021": true
|
|
6
|
-
},
|
|
7
|
-
"extends": [
|
|
8
|
-
"airbnb-base"
|
|
9
|
-
],
|
|
10
|
-
"overrides": [],
|
|
11
|
-
"parserOptions": {
|
|
12
|
-
"ecmaVersion": "latest"
|
|
13
|
-
},
|
|
14
|
-
"rules": {
|
|
15
|
-
"class-methods-use-this": "off",
|
|
16
|
-
"comma-dangle": [
|
|
17
|
-
"error",
|
|
18
|
-
"never"
|
|
19
|
-
],
|
|
20
|
-
"default-case": "off",
|
|
21
|
-
"import/extensions": ["error", "always", {"ignorePackages": true} ],
|
|
22
|
-
"import/no-extraneous-dependencies": [
|
|
23
|
-
"error",
|
|
24
|
-
{
|
|
25
|
-
"devDependencies": true
|
|
26
|
-
}
|
|
27
|
-
],
|
|
28
|
-
"indent": [
|
|
29
|
-
"error",
|
|
30
|
-
4,
|
|
31
|
-
{
|
|
32
|
-
"SwitchCase": 1
|
|
33
|
-
}
|
|
34
|
-
],
|
|
35
|
-
"max-len": ["warn", { "code": 120 }],
|
|
36
|
-
"no-plusplus": [
|
|
37
|
-
"error",
|
|
38
|
-
{
|
|
39
|
-
"allowForLoopAfterthoughts": true
|
|
40
|
-
}
|
|
41
|
-
],
|
|
42
|
-
"no-use-before-define": "off",
|
|
43
|
-
"padded-blocks": [
|
|
44
|
-
"error",
|
|
45
|
-
{
|
|
46
|
-
"classes": "always"
|
|
47
|
-
}
|
|
48
|
-
]
|
|
49
|
-
}
|
|
50
|
-
}
|