Knod – A Tiny HTTP server for your current directory with writes
github.com
github.com
Knod allows you to POST JSON data to a URL which it stores in a file so you can GET the same data back. If you're prototyping a one page JS app in, say, Ember this means that you don't need work on the backed logic, server or database. It's a pretty smart idea!
I wonder what it does on GET /items though? Hopefully it concatenates all file contents into a JSON array
I built a similar thing to help with that, built on App Engine (which I usually just run locally): https://github.com/ImJasonH/simply-put
It supports GET/POST/DELETE and simple queries.
I ended up having more fun writing the devel backend than whatever it was I was writing :)
Would be even better with a way to do something like this though :-)
python -m SimpleHTTPServeror
"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"
python3 -m http.server
php -S localhost:8000
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.
alias twisted_web='twistd -n web --path $PWD' pip install waitress
Is a good choice when you need a little more oomph but not nginx. busybox httpd -p 8080
I have not yet found any boxen having ruby but not busybox httpd.Other than OS X?
Maybe the default should be 127.0.0.1; and if the user specifies 0.0.0.0 then it comes with a big fat warning?
Additionally the pages were retrieved/saved from a local bare git repository and when some file was PUT it would be saved in a new commit and the branch would be updated. It allowed more collaboration, since multiple people could work on the same page without overwriting each others work.
Anonymous editing isn't yet implemented, but the idea is to have anyone being able to make changes (with some restrictions) and offer it to the site's owner (kind of like a pull request). It would allow wiki-like functionality for websites in general.
Javascript was used for more specialized editing tools, like adding rows to certain tables and calculating totals (for example for [HTML5 invoices](http://www.jonathantneal.com/blog/the-html5-invoice/)). Remove DOM elements when you're done editing and PUT the page back.
Recently I felt a bit constricted with this model, since some parts of the pages needed to be reused across multiple pages (like 'master pages' or blogpost entries). I've implemented a simple 2-way templating engine. Static pages can be built from the templates and from the page you could extract the templates, without losing data. That way you could edit the page as-is, but the parts that are templated are saved in the template (and reused in other pages). It did make the server more complex than a simple GET/PUT server, but the GET/PUT functionality was still preserved.
I see a lot of potential in such a GET/PUT server. With the right permissions for PUT operations, this can also be quite a decent 'CMS'-like server.
ruby -run -e httpd -- --port=8080 .`<class:Server>': undefined method `using' for Knod::Server:Class (NoMethodError)
Am I a loser?
ruby -run -e httpd . -p 5000