lite-web-server
Advanced tools
Comparing version 1.1.0 to 1.1.1
# Change Log | ||
## 1.1.1 ([npm](https://www.npmjs.com/package/lite-web-server/v/1.1.1) / [Github](https://github.com/chasyumen/lite-web-server/releases/tag/1.1.1)) | ||
### Changed | ||
- icon assets have been changed. | ||
### Fixed | ||
- Fixed a decode URL bug when load directory or files. | ||
## 1.1.0 ([npm](https://www.npmjs.com/package/lite-web-server/v/1.1.0) / [Github](https://github.com/chasyumen/lite-web-server/releases/tag/1.1.0)) | ||
@@ -4,0 +14,0 @@ |
@@ -0,1 +1,7 @@ | ||
/* | ||
lite-web-server | ||
Copyright (c) 2021 chasyumen | ||
MIT Licensed | ||
*/ | ||
var index = require("./src/index.js"); //this file loads ./lib/index.js | ||
@@ -2,0 +8,0 @@ var server = new index.WebServer({ |
@@ -0,1 +1,7 @@ | ||
/* | ||
lite-web-server | ||
Copyright (c) 2021 chasyumen | ||
MIT Licensed | ||
*/ | ||
'use strict' | ||
@@ -2,0 +8,0 @@ |
@@ -1,4 +0,1 @@ | ||
'use strict' | ||
/* | ||
@@ -10,2 +7,4 @@ lite-web-server | ||
'use strict' | ||
module.exports = require('./src'); |
@@ -33,3 +33,3 @@ { | ||
"better-docs": { | ||
"name": "lite-web-server v1.1.0", | ||
"name": "lite-web-server v1.1.1", | ||
"title": "lite-web-server Documentation", | ||
@@ -36,0 +36,0 @@ "css": "/style.css", |
{ | ||
"name": "lite-web-server", | ||
"version": "1.1.0", | ||
"version": "1.1.1", | ||
"description": "creates simple web server.", | ||
@@ -5,0 +5,0 @@ "devDependencies": { |
@@ -15,3 +15,5 @@ # lite-web-server | ||
[Simple Example Usage](https://gist.github.com/chasyumen/b96573602863354cedb2df963bbff425) | ||
## Install | ||
@@ -18,0 +20,0 @@ ``` |
@@ -0,1 +1,7 @@ | ||
/* | ||
lite-web-server | ||
Copyright (c) 2021 chasyumen | ||
MIT Licensed | ||
*/ | ||
'use strict' | ||
@@ -2,0 +8,0 @@ |
@@ -275,3 +275,3 @@ /*! | ||
if (cache[icon]) return cache[icon]; | ||
return cache[icon] = fs.readFileSync(__dirname + '/../../assets/serve-index/icons/' + icon, 'base64'); | ||
return cache[icon] = JSON.parse(fs.readFileSync(__dirname + '/../../assets/serve-index/icons.json'))[icon] | ||
} | ||
@@ -452,107 +452,107 @@ | ||
// base icons | ||
'default': 'page_white.png', | ||
'folder': 'folder.png', | ||
'default': 'page_white', | ||
'folder': 'folder', | ||
// generic mime type icons | ||
'font': 'font.png', | ||
'image': 'image.png', | ||
'text': 'page_white_text.png', | ||
'video': 'film.png', | ||
'font': 'font', | ||
'image': 'image', | ||
'text': 'page_white_text', | ||
'video': 'film', | ||
// generic mime suffix icons | ||
'+json': 'page_white_code.png', | ||
'+xml': 'page_white_code.png', | ||
'+zip': 'box.png', | ||
'+json': 'page_white_code', | ||
'+xml': 'page_white_code', | ||
'+zip': 'box', | ||
// specific mime type icons | ||
'application/javascript': 'page_white_code_red.png', | ||
'application/json': 'page_white_code.png', | ||
'application/msword': 'page_white_word.png', | ||
'application/pdf': 'page_white_acrobat.png', | ||
'application/postscript': 'page_white_vector.png', | ||
'application/rtf': 'page_white_word.png', | ||
'application/vnd.ms-excel': 'page_white_excel.png', | ||
'application/vnd.ms-powerpoint': 'page_white_powerpoint.png', | ||
'application/vnd.oasis.opendocument.presentation': 'page_white_powerpoint.png', | ||
'application/vnd.oasis.opendocument.spreadsheet': 'page_white_excel.png', | ||
'application/vnd.oasis.opendocument.text': 'page_white_word.png', | ||
'application/x-7z-compressed': 'box.png', | ||
'application/x-sh': 'application_xp_terminal.png', | ||
'application/x-msaccess': 'page_white_database.png', | ||
'application/x-shockwave-flash': 'page_white_flash.png', | ||
'application/x-sql': 'page_white_database.png', | ||
'application/x-tar': 'box.png', | ||
'application/x-xz': 'box.png', | ||
'application/xml': 'page_white_code.png', | ||
'application/zip': 'box.png', | ||
'image/svg+xml': 'page_white_vector.png', | ||
'text/css': 'page_white_code.png', | ||
'text/html': 'page_white_code.png', | ||
'text/less': 'page_white_code.png', | ||
'application/javascript': 'page_white_code_red', | ||
'application/json': 'page_white_code', | ||
'application/msword': 'page_white_word', | ||
'application/pdf': 'page_white_acrobat', | ||
'application/postscript': 'page_white_vector', | ||
'application/rtf': 'page_white_word', | ||
'application/vnd.ms-excel': 'page_white_excel', | ||
'application/vnd.ms-powerpoint': 'page_white_powerpoint', | ||
'application/vnd.oasis.opendocument.presentation': 'page_white_powerpoint', | ||
'application/vnd.oasis.opendocument.spreadsheet': 'page_white_excel', | ||
'application/vnd.oasis.opendocument.text': 'page_white_word', | ||
'application/x-7z-compressed': 'box', | ||
'application/x-sh': 'application_xp_terminal', | ||
'application/x-msaccess': 'page_white_database', | ||
'application/x-shockwave-flash': 'page_white_flash', | ||
'application/x-sql': 'page_white_database', | ||
'application/x-tar': 'box', | ||
'application/x-xz': 'box', | ||
'application/xml': 'page_white_code', | ||
'application/zip': 'box', | ||
'image/svg+xml': 'page_white_vector', | ||
'text/css': 'page_white_code', | ||
'text/html': 'page_white_code', | ||
'text/less': 'page_white_code', | ||
// other, extension-specific icons | ||
'.accdb': 'page_white_database.png', | ||
'.apk': 'box.png', | ||
'.app': 'application_xp.png', | ||
'.as': 'page_white_actionscript.png', | ||
'.asp': 'page_white_code.png', | ||
'.aspx': 'page_white_code.png', | ||
'.bat': 'application_xp_terminal.png', | ||
'.bz2': 'box.png', | ||
'.c': 'page_white_c.png', | ||
'.cab': 'box.png', | ||
'.cfm': 'page_white_coldfusion.png', | ||
'.clj': 'page_white_code.png', | ||
'.cc': 'page_white_cplusplus.png', | ||
'.cgi': 'application_xp_terminal.png', | ||
'.cpp': 'page_white_cplusplus.png', | ||
'.cs': 'page_white_csharp.png', | ||
'.db': 'page_white_database.png', | ||
'.dbf': 'page_white_database.png', | ||
'.deb': 'box.png', | ||
'.dll': 'page_white_gear.png', | ||
'.dmg': 'drive.png', | ||
'.docx': 'page_white_word.png', | ||
'.erb': 'page_white_ruby.png', | ||
'.exe': 'application_xp.png', | ||
'.fnt': 'font.png', | ||
'.gam': 'controller.png', | ||
'.gz': 'box.png', | ||
'.h': 'page_white_h.png', | ||
'.ini': 'page_white_gear.png', | ||
'.iso': 'cd.png', | ||
'.jar': 'box.png', | ||
'.java': 'page_white_cup.png', | ||
'.jsp': 'page_white_cup.png', | ||
'.lua': 'page_white_code.png', | ||
'.lz': 'box.png', | ||
'.lzma': 'box.png', | ||
'.m': 'page_white_code.png', | ||
'.map': 'map.png', | ||
'.msi': 'box.png', | ||
'.mv4': 'film.png', | ||
'.pdb': 'page_white_database.png', | ||
'.php': 'page_white_php.png', | ||
'.pl': 'page_white_code.png', | ||
'.pkg': 'box.png', | ||
'.pptx': 'page_white_powerpoint.png', | ||
'.psd': 'page_white_picture.png', | ||
'.py': 'page_white_code.png', | ||
'.rar': 'box.png', | ||
'.rb': 'page_white_ruby.png', | ||
'.rm': 'film.png', | ||
'.rom': 'controller.png', | ||
'.rpm': 'box.png', | ||
'.sass': 'page_white_code.png', | ||
'.sav': 'controller.png', | ||
'.scss': 'page_white_code.png', | ||
'.srt': 'page_white_text.png', | ||
'.tbz2': 'box.png', | ||
'.tgz': 'box.png', | ||
'.tlz': 'box.png', | ||
'.vb': 'page_white_code.png', | ||
'.vbs': 'page_white_code.png', | ||
'.xcf': 'page_white_picture.png', | ||
'.xlsx': 'page_white_excel.png', | ||
'.yaws': 'page_white_code.png' | ||
'.accdb': 'page_white_database', | ||
'.apk': 'box', | ||
'.app': 'application_xp', | ||
'.as': 'page_white_actionscript', | ||
'.asp': 'page_white_code', | ||
'.aspx': 'page_white_code', | ||
'.bat': 'application_xp_terminal', | ||
'.bz2': 'box', | ||
'.c': 'page_white_c', | ||
'.cab': 'box', | ||
'.cfm': 'page_white_coldfusion', | ||
'.clj': 'page_white_code', | ||
'.cc': 'page_white_cplusplus', | ||
'.cgi': 'application_xp_terminal', | ||
'.cpp': 'page_white_cplusplus', | ||
'.cs': 'page_white_csharp', | ||
'.db': 'page_white_database', | ||
'.dbf': 'page_white_database', | ||
'.deb': 'box', | ||
'.dll': 'page_white_gear', | ||
'.dmg': 'drive', | ||
'.docx': 'page_white_word', | ||
'.erb': 'page_white_ruby', | ||
'.exe': 'application_xp', | ||
'.fnt': 'font', | ||
'.gam': 'controller', | ||
'.gz': 'box', | ||
'.h': 'page_white_h', | ||
'.ini': 'page_white_gear', | ||
'.iso': 'cd', | ||
'.jar': 'box', | ||
'.java': 'page_white_cup', | ||
'.jsp': 'page_white_cup', | ||
'.lua': 'page_white_code', | ||
'.lz': 'box', | ||
'.lzma': 'box', | ||
'.m': 'page_white_code', | ||
'.map': 'map', | ||
'.msi': 'box', | ||
'.mv4': 'film', | ||
'.pdb': 'page_white_database', | ||
'.php': 'page_white_php', | ||
'.pl': 'page_white_code', | ||
'.pkg': 'box', | ||
'.pptx': 'page_white_powerpoint', | ||
'.psd': 'page_white_picture', | ||
'.py': 'page_white_code', | ||
'.rar': 'box', | ||
'.rb': 'page_white_ruby', | ||
'.rm': 'film', | ||
'.rom': 'controller', | ||
'.rpm': 'box', | ||
'.sass': 'page_white_code', | ||
'.sav': 'controller', | ||
'.scss': 'page_white_code', | ||
'.srt': 'page_white_text', | ||
'.tbz2': 'box', | ||
'.tgz': 'box', | ||
'.tlz': 'box', | ||
'.vb': 'page_white_code', | ||
'.vbs': 'page_white_code', | ||
'.xcf': 'page_white_picture', | ||
'.xlsx': 'page_white_excel', | ||
'.yaws': 'page_white_code' | ||
}; |
@@ -0,1 +1,10 @@ | ||
/* | ||
lite-web-server | ||
Copyright (c) 2021 chasyumen | ||
MIT Licensed | ||
*/ | ||
'use strict' | ||
const http = require('http'); | ||
@@ -180,3 +189,3 @@ const path = require('path'); | ||
} | ||
var url = req.url; | ||
var url = decodeURIComponent(req.url); | ||
//console.log(url); | ||
@@ -183,0 +192,0 @@ if (url == "/") { |
Sorry, the diff of this file is not supported yet
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
289777
1969
49
24