4 ms·
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 com
by jamescun 12y ago
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
- TinyBig 12y agoCouldn'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.
- rafekett 12y agoI'm curious -- what is your use case is for writing and deleting?
- samstave 12y ago"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"
- michaelmior 12y agoHow is a non-technical person supposed to execute a POST request with an attached file to Knod?
- jacquesm 12y agoAt a guess, using a browser with a file upload form downloaded from the same place where the file will go.
- michaelmior 12y agoThat's fair, although it goes beyond what Knowd provides.
- TinyBig 12y agoGot 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.
- failrate 12y agoI 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.
- tdicola 12y agoAnd for the python3 folks: python3 -m http.server
- deleted 12y ago[deleted]
- Joeri 12y agoSame thing for php 5.4+: php -S localhost:8000
- girvo 12y agoWhich (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 :)
- el_benhameen 12y agoI 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 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.
- woadwarrior01 12y agoIf 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'
- pekk 12y agoI 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.
- tdicola 12y agoI 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.
- mixmastamyk 12y agopip install waitress Is a good choice when you need a little more oomph but not nginx.
- ushi 12y agoI 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 https://github.com/cesanta/mongoose
- Hello71 12y agoor, even better (and supported almost everywhere): busybox httpd -p 8080 I have not yet found any boxen having ruby but not busybox httpd.
- acdha 12y ago> I have not yet found any boxen having ruby but not busybox httpd. Other than OS X?