Even after doing javascript since 2005, until recently I never had the chance to dig deep into it. Also, when I first came to know about node.js in 2010, it was a pretty nascent technology in those days and was not developer friendly. However, a lot has changed since then and now this technology app stack is not only matured, but is also mainstream. Considering the recent interviews that I undertook in last month, apart from rails skills, people also asked if I was comfortable with node.js, which might not be an indicator for the rails community, but is nevertheless a repetitive occurrence for me.
Currently the app stack stands as follows
Client--(ember/knockout/angular)----json data----Backbonejs(nodejs)---Json data---Mongodb(database)
This is essentially a complete app stack built on javascript (with DSLs thrown in for convenience - such as json).
Coming to backbone, it is quite similar to sinatra and is considerably easier when compared with native nodejs and many concepts are used similar to what has been done in the sinatra framework.
var express = require('express');
var util = require('util');
.... //Other libraries in use here
var app = express();
app.set('views', path.join(__dirname, 'views')); // set the views here
app.set('view engine', 'jade'); // using jade view engine
app.configure(function(){
//let the app use various activities
});
//routing stuff... that can also be delegated to separate files
app.get('/a/url/path', function(req, res){
res.render('jade_view_name');
});
app.post('/another_path'...
app.listen(8080); // port to listen upon
In the client side, there are a lot of Model, View + based javascript frameworks out of which I am learning angular and ember frameworks. Currently I am not biased towards/against any framework out there and will definitely post my experiences..
No comments:
Post a Comment