Skip to content

imcuttle/http-file-explorer-express4.x

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

HTTP文件浏览 Version2

改进

之前做的HTTP浏览是使用express2.x版本做的...,因为参考书比较旧了。

  1. express2.x中没有express4.x中的res.sendFile()方法,之前发送文件是使用的stream.pipe()方法,导致不支持继续下载,而且用户不能知道下载进度,在线音乐视频播放也不能选择时间跳跃欣赏。res.sendFile()方法可以将本地文件以静态资源发送给用户,所有问题迎刃而解。
  2. 旧版本不支持java/c/cpp/js/css/html等代码文件和md/markdown文件在线查看,所以进行改进。
  3. 利用Bootstrap responsive utilsBootstrap grid system进行响应式布局。
  4. 监控root.txt文件,改变root后无需重启服务器。
  5. 去除对q.js依赖,使用原生Promise

说明

  • root.txt :共享文件夹路径
  • app.js :入口

使用

  1.   npm install
    
  2.   npm start
    
  3.   http://localhost:3500/ 
    

About

http-file-explorer-express4.x

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published