Code Monkey home page Code Monkey logo

filemanager's Introduction

这是一个静态文件服务器,服务说明:

一、服务只是读取该项目(FileManager)中的文件;

二、效果预览:

你只需要运行项目中的server.js文件,然后,在浏览器中输入:localhost:8080 或者 127.0.0.1:8080 即可预览。

三、做题思路:

1、获取项目的绝对路径;

2、获取请求的path,进行路径拼接;

判断请求,如果是icon则忽略;

else 执行3

3、判断请求的url是否存在;

存在:

  (1)、判断文件是文件夹还是文件目录
      
         目录:遍历目录下的所有文件,

         文件:判断文件的类型,读取文件,然后响应数据。
          

   (2)、获取一个路径,给文件的href

不存在:404,end;

filemanager's People

Contributors

liujinyu2123233 avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.