static-cling
Advanced tools
Comparing version 2.0.0 to 2.0.1
@@ -11,3 +11,3 @@ const handler = require('./handler') | ||
const config = { ...defaults, ...options } | ||
console.log('config', options) | ||
const serverHandler = handler(config) | ||
@@ -17,3 +17,3 @@ | ||
s.listen(config.port) | ||
console.log('server') | ||
console.info('Server Started') | ||
} |
const http = require('http') | ||
module.exports = handler => { | ||
return http.createServer(handler) | ||
} | ||
} |
{ | ||
"name": "static-cling", | ||
"version": "2.0.0", | ||
"version": "2.0.1", | ||
"engines": [ | ||
@@ -16,3 +16,3 @@ "node >=8.0.0" | ||
}, | ||
"homepage": "http://kevinisom.info/static-cling", | ||
"homepage": "http://kevinisom.info/Static-Cling/", | ||
"scripts": { | ||
@@ -53,2 +53,2 @@ "test": "mocha ./test/super.test.js", | ||
} | ||
} | ||
} |
@@ -1,24 +0,33 @@ | ||
#Static Cling | ||
# Static Cling | ||
This is a node.js module that allows you to spin up a static file server either from code or from the command line. | ||
###Installing | ||
$ npm install static-cling | ||
### Installing | ||
```bash | ||
npm install static-cling | ||
``` | ||
Don't forget to use the global flag (--g) if you want the command line option everywhere. | ||
###At the command line | ||
$ static | ||
### At the command line | ||
```bash | ||
static | ||
``` | ||
Yeah, that's it. You have the option to pass in -p for port, otherwise it defaults to port 3000, -d for directory, if you want to specify a different directory than the one you are in, and lastly -f for the default html page, this defaults to index.html | ||
###In Code | ||
### In Code | ||
Static Cling is available to be used as a module as well if you want to use node to host static files. | ||
```js | ||
require('static-cling')(); | ||
``` | ||
require('static-cling').cling(); | ||
``` | ||
### Options | ||
If using the module you can override the defaults by providing a config object | ||
``` | ||
```js | ||
//defaults | ||
@@ -30,4 +39,5 @@ var config = { | ||
} | ||
const cling = require('static-cling') | ||
//overriding defaults | ||
cling({ port: 3456, root : './other/', filename: 'test.html' }); | ||
``` |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
No website
QualityPackage does not have a website.
Found 1 instance in 1 package
15714
0
43
2