March 03, 2020

Run local file server with NPM http-server

Hi folks,

Today i'll explian the process of making your folder as a standalone file server.

Objective

Make my folder contents browse over http

Procedure


  • Install Node
  • Install http-server module in node globally
    • npm install -g http-server
  • Open terminal/command-prompt
  • Navigate to your folder
  • Run the following command to start the server
    • http-server .
  • or simply run
    • hs .
  • Run from anywhere with full path of the folder
    • hs C:\FileFolder
  • Starting up http-server, serving .
  • Available on:
    • http://10.10.6.2:8080
    • http://127.0.0.1:8080
    • http://youripaddress:8080
  • Hit CTRL-C to stop the server
  • You should be able to browse your file folder contents with any of the above URLs
Hope you are able to access your file contents over the browser

Tip: Using this approach, you can share your content over intranet/internet with full control over data as read only.

After stopped the server, access to the folder is stopped.

Please send your comments and feedback to psrdotcom@gmail.com

No comments:

Featured Post

Java Introdcution

Please send your review and feedback to psrdotcom@gmail.com