Is there a super lightweight file server that I could use for development on my mac?

I'm imagining something like:

> cd somefolder
> run server
  ...running static file server at http://0.0.0.0:2343...

It's only for development of static html/css/js/images - no outside connections needed.

有帮助吗?

解决方案

Sure! And it's already installed.

Just try this:

cd path/to/files
python3 -m http.server

If you want to run it on a specific port instead of 8000 (the default), just append the port number as a second argument, like:

python3 -m http.server 2343
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top