Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

static-cling

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

static-cling - npm Package Compare versions

Comparing version 0.0.4 to 0.0.5

0

bin/static.js

@@ -0,0 +0,0 @@ #!/usr/bin/env node

25

lib/static.js

@@ -5,3 +5,11 @@ var path = require('path'),

url = require('url'),
mime = require('mime');
mime = require('mime'),
sendFileNotFound = function(res){
res.writeHead(404, {
'Content-Type': 'text/plain'
});
res.write('404 - File Not Found\n');
res.end();
return;
};

@@ -13,3 +21,3 @@ var cling = function(port,rootPath, defaultFilename){

if(port === undefined){
port=3000;
port = 3000;
}

@@ -19,3 +27,3 @@ if(defaultFilename === undefined){

}
http.createServer(function (req, res) {

@@ -26,8 +34,4 @@ var uri = url.parse(req.url).pathname;

if (!exists) {
res.writeHead(404, {
'Content-Type': 'text/plain'
});
res.write('404 - File Not Found\n');
res.end();
return;
return sendFileNotFound(res);
}

@@ -37,2 +41,5 @@

filename = path.join(filename, defaultFilename);
if(!path.existsSync(filename)){
return sendFileNotFound(res);
}
}

@@ -39,0 +46,0 @@

{ "name": "static-cling"
, "version": "0.0.4"
, "version": "0.0.5"
, "engines": [ "node >=0.6.0" ]
, "description": "Static file server"
, "author": "Kevin Isom (http://kevinisom.info)"
, "repository" : {
"type" : "git"
, "url" : "git@github.com:Kevnz/Static-Cling.git"
}
, "bugs" : {
"url": "https://github.com/Kevnz/Static-Cling/issues"
}
, "keywords" : [ "webserver", "fileserver" ]

@@ -10,5 +17,5 @@ , "bin" : { "static" : "./bin/static.js" }

, "directories": {
"lib": "./lib/static"
"lib": "./lib/static"
}
, "main": "./lib/static"
}
var cling = require('../lib/static').cling,
port= 8083;
console.log('starting server with port ' + port)
cling();
cling(port);

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc