http-party / http-server

a simple zero-configuration command-line http server
MIT License
13.42k stars 1.48k forks source link

http-server runing on project root folder path without any reasons #862

Open StephaneBonilla opened 11 months ago

StephaneBonilla commented 11 months ago

Environment Versions

  1. Windows 11
  2. Node version: v18.16.1
  3. http-server version: v14.1.1

Steps to reproduce

I have a project with a dist folder. When i open a terminal in that folder and run http-server, it use the project root folder instead of the folder where i opened the terminal.

Expected result

http-server root path should use the path of the folder i opened the terminal

Actual result

Http-server root path is using the project root path.

Other information

image

github-actions[bot] commented 5 months ago

This issue has been inactive for 180 days

ruoyush commented 5 months ago

I encountered the same problem on linux. And the reason for me is the permission. After I added 777 permission recursively to the dist folder, It worked by running the http-server under the dist directory.

henriquemattos commented 2 days ago

Still happening for me on version 1.0.1, but I've found a hint in a README file that pointed me to avoid -o and just use the path directly.

The following works:

http-serve -p 9000 dist