New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

local-server

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

local-server - npm Package Compare versions

Comparing version

to
0.1.1

7

lsrv.js

@@ -8,3 +8,3 @@ #!/usr/bin/env node

var PORT_NUMBER = Number(process.argv[2]) || 8000,
ROOT_FOLDER = './',
ROOT_FOLDER = Number(process.argv[3]) || './',
MIME_TYPES = {

@@ -27,4 +27,5 @@ '.html' : 'text/html',

if (err) {
res.writeHead(err.code == 'ENOENT' ? 404: 500, { 'Content-Type': 'text/html' })
res.writeHead(err.code == 'ENOENT' ? 404 : 500, { 'Content-Type': 'text/html' })
res.end(err.toString())
console.log('Error', err)
} else if (stat.isDirectory()) {

@@ -42,2 +43,2 @@ handle(path.join(filePath, 'index.html'))

console.log('Server running at http://localhost:' + PORT_NUMBER + '/')
console.log('Server running at http://localhost:' + PORT_NUMBER + '/' + ' with root ' + ROOT_FOLDER)
{
"name": "local-server",
"main": "local-server",
"version": "0.1.0",
"version": "0.1.1",
"description": "Minimal zero-dependency static web server",

@@ -6,0 +6,0 @@ "homepage": "http://buunguyen.github.io/local-server",

@@ -13,7 +13,7 @@ local-server

```
cd ~/somedir
node ./lsrv.js [optional port]
=> Server running at http://localhost:8000/
cd ~/some/dir
lsrv [port, default: 8000] [root, default: current folder]
=> Server running at http://localhost:8000/ with root ./
```
That's all!