38 ms·
It lets you choose whatever ORM (Mongoose!), templating (Weld!), and CRUD routing you want. It's like Rack or maybe Sinatra, but definitely not Rails. And it'
by bronson 15y ago
It lets you choose whatever ORM (Mongoose!), templating (Weld!), and CRUD routing you want. It's like Rack or maybe Sinatra, but definitely not Rails.
And it's much nicer to use than the http module: layerable middleware, streaming responses, routing...
- troyk 15y agoGranted I blazed through the docs and am not a node expert, but for a streaming web framework I could not find a reference to streaming responses. It is very Rackish, all examples I found point to calling callback(200, {}, "Hello world!"); What I don't get, is you have to fight with Rack to get anything close to async, yet here comes a web framework for an async environment modeled after Rack, go figure. I assume (meaning I'm about to make an ass out of u & an ass out of me) the answer is to pass a stream in place of the "Hello world!" string, but that would cause hell with any middleware expecting a completed response.
- mjijackson 15y agoThe Strata spec states that a body may be either a string or a stream. All Strata middleware that needs to modify the body in some way must account for this. It's not difficult to do a "if (typeof body == 'string')". Strata borrows many concepts from Rack, but not the synchronous part. Instead of expecting your app to return something, Strata gives you a callback that you can use to serve the response when you're ready. I admit the manual could probably give a better example of streaming a response. For now, check out the static file serving middleware (https://github.com/mjijackson/strata/tree/master/lib/static.js https://github.com/mjijackson/strata/tree/master/lib/static....). You'll see that the response body is simply a readable stream to the file on disk.
- troyk 15y agoThanks, I get it now. Think I'll go play some SSE with it http://www.igvita.com/2011/08/26/server-sent-event-notifications-with-html5/ http://www.igvita.com/2011/08/26/server-sent-event-notificat...