Node.js quick file server (static files over HTTP)

前端 未结 30 2211
攒了一身酷
攒了一身酷 2020-11-22 12:30

Is there Node.js ready-to-use tool (installed with npm), that would help me expose folder content as file server over HTTP.

Example, if I have



        
30条回答
  •  一整个雨季
    2020-11-22 13:06

    If you use the Express framework, this functionality comes ready to go.

    To setup a simple file serving app just do this:

    mkdir yourapp
    cd yourapp
    npm install express
    node_modules/express/bin/express
    

提交回复
热议问题