Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

While it doesn't support writing (POST/PUT etc), for serving files over HTTP from the current directory, Python's built in HTTP server is perfectly fine. It comes with Python 2.4+ as standard.

    python -m SimpleHTTPServer


Couldn't agree more - if all you need is a static file server, SimpleHTTPServer does the job. I made Knod specifically because I could not find a built in HTTP server that allows writing and deleting.


I'm curious -- what is your use case is for writing and deleting?


Got the idea while working through the React tutorial some time ago. Thought a zero config server that responds to all of the HTTP verbs would make a nice tool for front end prototyping.


"Hey bob, here is a link to a folder on my machine - can you upload that those [random file types] you want me to look at?"

or

"non-tech wife needs to get this file to our home machine, she can use my link to /home/put/ to send this to my home machine from her work"


How is a non-technical person supposed to execute a POST request with an attached file to Knod?


At a guess, using a browser with a file upload form downloaded from the same place where the file will go.


That's fair, although it goes beyond what Knowd provides.


I extended Python SimpleHTTPServer as a data store server for some web games and also as a cross-site XML server for said games. Knod would fit that niche just fine.


I am big fan of the mongoose server[0]. This python thing has issues handling concurrent requests, but i use it as a fallback, if mongoose is not installed.

[0] https://github.com/cesanta/mongoose


I used SimpleHTTPServer for a while, but I found it a bit sluggish at times. I replaced SimpleHTTPServer with http-server, and I've been very pleased with its performance:

https://github.com/nodeapps/http-server

Not standard (or Python), but it's a quick install, and I find it just as usable and much faster.


If you have twisted installed (which is the case on stock OSX), you can use the twisted webserver, which is a lot faster than SimpleHTTPServer and supports concurrent multiple downloads & resumes. I use this alias:

    alias twisted_web='twistd -n web --path $PWD'


And for the python3 folks:

python3 -m http.server


I wish this weren't true, but it's a terrible server - all but unusable. Just try to serve requests to several hosts within the same few seconds.


I don't think it was ever meant to be a server beyond a single user on a single machine. It's great for spinning up a server to start prototyping some web pages, etc. locally. Trying to serve content to multiple users (especially at the same time) is asking for trouble.


    pip install waitress
Is a good choice when you need a little more oomph but not nginx.


or, even better (and supported almost everywhere):

    busybox httpd -p 8080
I have not yet found any boxen having ruby but not busybox httpd.


> I have not yet found any boxen having ruby but not busybox httpd.

Other than OS X?


Same thing for php 5.4+:

php -S localhost:8000


Which (coupled with SQLite) is what I use for all my PHP development stuff. No futzing around with Nginx or Apache configs, and a Phing or Makefile to run `make server` loading my particular dev setup (setting temporary ENV variables and the like) for the project is priceless. That feature is one of my favourites :)




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: