3 ms·
I'm disappointed that this is mostly a joke. I really like the docs and have been looking for something along these lines lately.
by whalesalad 14y ago
I'm disappointed that this is mostly a joke. I really like the docs and have been looking for something along these lines lately.
- KaoruAoiShiho 14y ago? What's wrong with express?
- whalesalad 14y agoDo you know how much boilerplate crap is required before you can do hello world with express?
- deleted 14y ago[deleted]
- secoif 14y ago>Do you know how much boilerplate crap is required before you can do hello world with express? This much: var app = require('express')(); app.get('*', function(req, res) { res.send('hello world'); }); app.listen(8080); Hello world probably a bad example.
- danneu 14y agoZappa[0] is a cool Coffeescript wrapper around Express. Unfortunately, Maurice Machado[1] dropped off the radar last October so some other people stepped in to maintain it at https://github.com/zappajs/zappajs https://github.com/zappajs/zappajs. Maurice also wrote Coffeekup[2] (a Coffeescript Jade) which has also been taken over by the community as a project called Coffeecup[3]. (Sincerely hope Maurice is ok. He was real active and put a lot of effort into his projects up until his disappearance.) [0]: http://zappajs.org/docs/crashcourse/ [1]: http://twitter.com/mauricemach [2]: http://coffeekup.org/ && https://github.com/mauricemach/coffeekup [3]: https://github.com/gradus/coffeecup
- gee_totes 14y agoYeah, the thing that gave it way for me was: * Since this is such a small module, it’s almost certainly bug-free
- grncdr 14y agoWarning: shameless self-promotion ahead: db = require('./your_sexy_data_access_module') server = require('lazorse').server port: 3000, -> # in this context we register resources the app using @resource @resource '/things/{thingId}': shortName: "Things" GET: -> db.getThing @thingId, @data POST: -> db.getThing @thingId, (err, thing) => return @next(err) if err thing.update(@req, @data) Where @data is node-style callback function taking (err, data), and the data will be rendered by a separate middleware layer that inspects Accept headers and does the Right Thing. There's a lot more than should be covered in an HN comment, but in interest of DRYing out the above example, let's rewrite it to use a coercion to retrieve "thing" instances. db = require('./your_sexy_data_access_module') server = require('lazorse').server port: 3000, -> @coerce 'thing', "Things are whatever this app deals in", db.getThing @resource '/things/{thing}': shortName: "Things" GET: -> # Use @ok because we won't get here if there was an error retrieving # the thing @ok @thing POST: -> @thing.update @req, @data See http://betsmartmedia.github.com/Lazorse http://betsmartmedia.github.com/Lazorse for full API docs and examples. Bug reports, pull requests, flame comments etc. are all very welcome :)