Show HN: draughtsman, a webserver for front-end devs
github.com
github.com
I do a lot of front-end prototypes for apps and websites I may or may not want to keep on building, and because of the throwaway quality of those things I don't want to be bothered with keeping all sorts of autocompiling scripts running for CoffeeScript, SASS et cetera, and I also don't want to start a Rails or Django project (yes, I use both) just for the sake of having transparent precompilation of those assets, and I also don't want to limit myself to writing plain HTML and CSS.
A bit more information over here: http://stdout.be/2011/10/25/draughtsman/
It's maybe a couple hundred lines of code, so easy to read through if that's your thing.
Just scratching my own itch here, but I'm curious to see what you guys think.
It's <100 lines of code, and really quite primitive; if you request hello.css, and that file exists, it serves that. If it doesn't exist, but hello.sass does, it'll compile and serve that instead. Same goes for .haml and .coffee files requested with .html and .js respectively. No configuration, no required file structure — just prototype as you would with just HTML/CSS…except using the compiled templates you love!
Three things draughtsman adds on top of Convey:
* No need for projects: works in any directory.
* The ability to use JSON / YAML to populate templates; especially useful if you already have some JSON sample data you can use.
* Offline resources: makes jQuery and underscore.js available at the root, regardless of whether they're actually in that directory.
The one thing it misses that Convey has:
* The ability to save the compiled files to a directory.
Like the idea of using JSON to populate templates though, that's neat!
I figure most people will want to use it more like Apache though: set & forget & loads at startup.
Don't know if I'd call draughtsman advanced: it's too small for that. Or maybe its diminutive size is a testament to node.js its power for anything related to servers and proxies; I probably wouldn't have bothered if I had had to write a server like this in any other language.
You just run it like `here` and optionally pass a port (uses 8080 by default) or directory (uses current directory by default)
It's written in C and has support for modules. I was planning to write a PHP module for it, but that idea never got off the ground.
It's in Ruby instead of Node and is a bit less opinionated about how a project should look like. I wrote it when I became frustrated with the options for writing rich client apps in compiled languages (HAML/SASS/CoffeeScript). It's so convenient to be able to cd to a directory and do "slinky start" and have a static file server running.
https://github.com/iaindooley/Fragmentify
EDIT: sorry the doco is so lame at the moment - just threw it online the other day and haven't had the chance to flesh it out at all.
I like how Middleman handles layout templates, YAML front matter, dynamic pages and livereload. Dislike the idea of including Sprockets for asset management though, seems too much cruft for just prototyping. Suppose it makes sense if you want a tool that doubles as a static site generator.