diff --git a/README.md b/README.md index bbbe7be..255271a 100644 --- a/README.md +++ b/README.md @@ -29,14 +29,14 @@ Package Quality : ## cli use if you just want to test -Now you can also use the nodeserver cli if you just want to spin up a basic file server to test something out quickly or share on the local network. +Now you can also use the node-http-server cli if you just want to spin up a basic file server to test something out quickly or share on the local network. ```sh $ sudo npm i -g node-http-server -//start a nodeserver from the current directory on the default port 8080 -$ nodeserver +//start a node-http-server from the current directory on the default port 8080 +$ node-http-server ``` @@ -44,8 +44,8 @@ You can modify any of the config keys by passing their key value pairs as args. ```sh -//start a verbose nodeserver from the current directory on port 1942 -$ nodeserver port=1942 verbose=true +//start a verbose node-http-server from the current directory on port 1942 +$ node-http-server port=1942 verbose=true ``` diff --git a/bin/nodeserver.js b/bin/nhs.js similarity index 100% rename from bin/nodeserver.js rename to bin/nhs.js diff --git a/docs/README.md.html b/docs/README.md.html index 9012a9a..614da9d 100644 --- a/docs/README.md.html +++ b/docs/README.md.html @@ -50,7 +50,7 @@ @@ -82,23 +82,23 @@

Support for building proxy servers has been added. Documentation coming in next release. For now see the node-http-server proxy examples.

npm i node-http-server

-

node-http-server stats

npm info : See npm trends and stats for node-http-server
node-http-server npm version supported node version for node-http-server total npm downloads for node-http-server monthly npm downloads for node-http-server npm licence for node-http-server

-

GitHub info :
node-http-server GitHub Release GitHub license node-http-server license open issues for node-http-server on GitHub

+

GitHub info :
node-http-server GitHub Release GitHub license node-http-server license open issues for node-http-server on GitHub Codacy Badge

+

node-http-server stats

Package Quality :
node-http-server Package Quality

See the code documentation on riaevangelist.github.io

cli use if you just want to test

-

Now you can also use the nodeserver cli if you just want to spin up a basic file server to test something out quickly or share on the local network.

+

Now you can also use the node-http-server cli if you just want to spin up a basic file server to test something out quickly or share on the local network.


 $ sudo npm i -g node-http-server
 
-//start a nodeserver from the current directory on the default port 8080
-$ nodeserver
+//start a node-http-server from the current directory on the default port 8080
+$ node-http-server
 

You can modify any of the config keys by passing their key value pairs as args.


-//start a verbose nodeserver from the current directory on port 1942
-$ nodeserver port=1942 verbose=true
+//start a verbose node-http-server from the current directory on port 1942
+$ node-http-server port=1942 verbose=true
 

quick npm script tests and examples


@@ -113,6 +113,9 @@ 

quick npm script tests and examples #node ./example/advanced/basicTemplate.js npm run template + +#node ./example/basic/cluster-basicApp.js +npm run cluster

writing a node http or https server

The below table shows all of the methods available on the server when you require this module.

@@ -219,7 +222,7 @@

deploy

userConfig no -if a userConfig object is passed it will decorate the Config class +if a userConfig object is passed it will decorate the Config class readyCallback @@ -701,7 +704,7 @@

Multiple domains or subdomains

server.deploy(config); -

Config Class

+

Config Class

Default node HTTP server configuration

All of these can be modified and passed into new server.Server(myConfigs) or server.deploy(myConfigs)


diff --git a/docs/bin/nhs.js.html b/docs/bin/nhs.js.html
new file mode 100644
index 0000000..a3972dc
--- /dev/null
+++ b/docs/bin/nhs.js.html
@@ -0,0 +1,86 @@
+
+
+
+    nhs
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+
+    
+    
+    
+    
+    
+    
+    
+    
+    
+
+    
+
+
+

+ nhs +

+
+ ./bin/nhs.js +
+ + +
+
    + + +
  • +
    + +
    +
    #! /usr/bin/env node
    +const server=require('../server/Server.js');
    +
    +server.deploy();
    +
    +
  • + +
+
+ + diff --git a/docs/example/advanced/basicTemplate.js.html b/docs/example/advanced/basicTemplate.js.html index 1071895..1c31295 100644 --- a/docs/example/advanced/basicTemplate.js.html +++ b/docs/example/advanced/basicTemplate.js.html @@ -50,7 +50,7 @@ diff --git a/docs/example/advanced/https-ONLY-basicTemplate.js.html b/docs/example/advanced/https-ONLY-basicTemplate.js.html index d514714..4606f9c 100644 --- a/docs/example/advanced/https-ONLY-basicTemplate.js.html +++ b/docs/example/advanced/https-ONLY-basicTemplate.js.html @@ -50,7 +50,7 @@ diff --git a/docs/example/advanced/https-basicTemplate.js.html b/docs/example/advanced/https-basicTemplate.js.html index 797590d..9865800 100644 --- a/docs/example/advanced/https-basicTemplate.js.html +++ b/docs/example/advanced/https-basicTemplate.js.html @@ -50,7 +50,7 @@ diff --git a/docs/example/advanced/https-randomCSS.js.html b/docs/example/advanced/https-randomCSS.js.html index ed476f1..4dc96a2 100644 --- a/docs/example/advanced/https-randomCSS.js.html +++ b/docs/example/advanced/https-randomCSS.js.html @@ -50,7 +50,7 @@ diff --git a/docs/example/advanced/https-requestBenchmark.js.html b/docs/example/advanced/https-requestBenchmark.js.html index f888766..4ef6f2f 100644 --- a/docs/example/advanced/https-requestBenchmark.js.html +++ b/docs/example/advanced/https-requestBenchmark.js.html @@ -50,7 +50,7 @@ diff --git a/docs/example/advanced/randomCSS.js.html b/docs/example/advanced/randomCSS.js.html index 451e2dd..28167bf 100644 --- a/docs/example/advanced/randomCSS.js.html +++ b/docs/example/advanced/randomCSS.js.html @@ -50,7 +50,7 @@ diff --git a/docs/example/advanced/requestBenchmark.js.html b/docs/example/advanced/requestBenchmark.js.html index 11a11b1..0de8688 100644 --- a/docs/example/advanced/requestBenchmark.js.html +++ b/docs/example/advanced/requestBenchmark.js.html @@ -50,7 +50,7 @@ diff --git a/docs/example/basic/advancedApp.js.html b/docs/example/basic/advancedApp.js.html index 98bd428..7f98f7e 100644 --- a/docs/example/basic/advancedApp.js.html +++ b/docs/example/basic/advancedApp.js.html @@ -50,7 +50,7 @@ diff --git a/docs/example/basic/basicApp.js.html b/docs/example/basic/basicApp.js.html index cb8d83b..6ebf613 100644 --- a/docs/example/basic/basicApp.js.html +++ b/docs/example/basic/basicApp.js.html @@ -50,7 +50,7 @@ diff --git a/docs/example/basic/basicLogging.js.html b/docs/example/basic/basicLogging.js.html index 74680bf..bfc090f 100644 --- a/docs/example/basic/basicLogging.js.html +++ b/docs/example/basic/basicLogging.js.html @@ -50,7 +50,7 @@ diff --git a/docs/example/basic/cluster-basicApp.js.html b/docs/example/basic/cluster-basicApp.js.html index 0f10853..e652fc0 100644 --- a/docs/example/basic/cluster-basicApp.js.html +++ b/docs/example/basic/cluster-basicApp.js.html @@ -50,7 +50,7 @@ diff --git a/docs/example/basic/https-ONLY-basicApp.js.html b/docs/example/basic/https-ONLY-basicApp.js.html index 55310b8..8ea944a 100644 --- a/docs/example/basic/https-ONLY-basicApp.js.html +++ b/docs/example/basic/https-ONLY-basicApp.js.html @@ -50,7 +50,7 @@ diff --git a/docs/example/basic/https-advancedApp.js.html b/docs/example/basic/https-advancedApp.js.html index ea69b03..1e8e366 100644 --- a/docs/example/basic/https-advancedApp.js.html +++ b/docs/example/basic/https-advancedApp.js.html @@ -50,7 +50,7 @@ diff --git a/docs/example/basic/https-basicApp.js.html b/docs/example/basic/https-basicApp.js.html index df843a7..225fdf5 100644 --- a/docs/example/basic/https-basicApp.js.html +++ b/docs/example/basic/https-basicApp.js.html @@ -50,7 +50,7 @@ diff --git a/docs/example/basic/https-basicLogging.js.html b/docs/example/basic/https-basicLogging.js.html index 048ead2..f6f3e66 100644 --- a/docs/example/basic/https-basicLogging.js.html +++ b/docs/example/basic/https-basicLogging.js.html @@ -50,7 +50,7 @@ diff --git a/docs/example/basic/https-multipleDomains.js.html b/docs/example/basic/https-multipleDomains.js.html index 28c6968..3d01580 100644 --- a/docs/example/basic/https-multipleDomains.js.html +++ b/docs/example/basic/https-multipleDomains.js.html @@ -50,7 +50,7 @@ diff --git a/docs/example/basic/https-verboseApp.js.html b/docs/example/basic/https-verboseApp.js.html index 5c94fb8..cef7750 100644 --- a/docs/example/basic/https-verboseApp.js.html +++ b/docs/example/basic/https-verboseApp.js.html @@ -50,7 +50,7 @@ diff --git a/docs/example/basic/multipleDomains.js.html b/docs/example/basic/multipleDomains.js.html index cdf3d37..5df333b 100644 --- a/docs/example/basic/multipleDomains.js.html +++ b/docs/example/basic/multipleDomains.js.html @@ -50,7 +50,7 @@ diff --git a/docs/example/basic/verboseApp.js.html b/docs/example/basic/verboseApp.js.html index f46c140..45a242c 100644 --- a/docs/example/basic/verboseApp.js.html +++ b/docs/example/basic/verboseApp.js.html @@ -50,7 +50,7 @@ diff --git a/docs/example/proxy/basic.js.html b/docs/example/proxy/basic.js.html index 54351da..4c1ca9d 100644 --- a/docs/example/proxy/basic.js.html +++ b/docs/example/proxy/basic.js.html @@ -50,7 +50,7 @@ diff --git a/docs/example/proxy/https-and-http-basic.js.html b/docs/example/proxy/https-and-http-basic.js.html index e4bd6c4..77ca271 100644 --- a/docs/example/proxy/https-and-http-basic.js.html +++ b/docs/example/proxy/https-and-http-basic.js.html @@ -50,7 +50,7 @@ diff --git a/docs/example/proxy/https-and-http-google-proxy.js.html b/docs/example/proxy/https-and-http-google-proxy.js.html index f6aaf67..74cee3b 100644 --- a/docs/example/proxy/https-and-http-google-proxy.js.html +++ b/docs/example/proxy/https-and-http-google-proxy.js.html @@ -50,7 +50,7 @@ diff --git a/docs/example/readme.md.html b/docs/example/readme.md.html index 3f0bd8b..c451964 100644 --- a/docs/example/readme.md.html +++ b/docs/example/readme.md.html @@ -50,7 +50,7 @@ diff --git a/docs/local-certs/readme.md.html b/docs/local-certs/readme.md.html index 1d6eaf3..72df97a 100644 --- a/docs/local-certs/readme.md.html +++ b/docs/local-certs/readme.md.html @@ -50,7 +50,7 @@ diff --git a/docs/server/Config.js.html b/docs/server/Config.js.html index 36f95f3..b7d3e53 100644 --- a/docs/server/Config.js.html +++ b/docs/server/Config.js.html @@ -50,7 +50,7 @@ @@ -105,77 +105,13 @@

Config Class

class Config{
     constructor(userConfig){
-        Object.defineProperties(
-            this,
-            {
-                verbose     : {
-                    value:defaultConfigs.verbose,
-                    enumerable:true,
-                    writable:true
-                },
-                port        : {
-                    value:defaultConfigs.port,
-                    enumerable:true,
-                    writable:true
-                },
-                root        : {
-                    value:defaultConfigs.root,
-                    enumerable:true,
-                    writable:true
-                },
-                domain      : {
-                    value:defaultConfigs.domain,
-                    enumerable:true,
-                    writable:true
-                },
-                https       : {
-                    value:defaultConfigs.https,
-                    enumerable:true,
-                    writable:true
-                },
-                log         : {
-                    value:defaultConfigs.log,
-                    enumerable:true,
-                    writable:true
-                },
-                logFunction : {
-                    value:defaultConfigs.logFunction,
-                    enumerable:true,
-                    writable:true
-                },
-                domains     : {
-                    value:defaultConfigs.domains,
-                    enumerable:true,
-                    writable:true
-                },
-                server      : {
-                    value:defaultConfigs.server,
-                    enumerable:true,
-                    writable:true
-                },
-                contentType : {
-                    value:defaultConfigs.contentType,
-                    enumerable:true,
-                    writable:true
-                },
-                restrictedType: {
-                    value:defaultConfigs.restrictedType,
-                    enumerable:true,
-                    writable:true
-                },
-                errors      : {
-                    value:defaultConfigs.errors,
-                    enumerable:true,
-                    writable:true
-                }
-            }
-        );
+      Object.assign(this,defaultConfigs);
 
-        if(userConfig){
-            for(const k in userConfig){
-                config[k]=userConfig[k];
-            }
-        }
+      if(userConfig){
+          for(const k in userConfig){
+              this[k]=userConfig[k];
+          }
+      }
     }
 }
diff --git a/docs/server/Server.js.html b/docs/server/Server.js.html index e7f03b9..d6860ed 100644 --- a/docs/server/Server.js.html +++ b/docs/server/Server.js.html @@ -50,7 +50,7 @@ diff --git a/package.json b/package.json index f37a9f7..59960e8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "node-http-server", - "version": "7.0.0", + "version": "7.1.0", "description": "A very simple and fast http server for node, bash, and spawnable from C, Python etc. It is lightweight and great for embedded solutions as well as everyday development or public facing apps.", "main": "server/http.js", "directories": { @@ -10,7 +10,7 @@ "node": ">=6.5.0" }, "bin": { - "nodeserver": "bin/nodeserver.js" + "node-http-server": "bin/nhs.js" }, "scripts": { "test": "echo \"Error: no test specified\" && exit 1",