App.get() in Node.JS

Using express we can easily call the function get() like :

var app = express();

app.get('/',function(req,res){
    // do stuff
})

What is the equivalent in node.js ? So how can I do the same thing without express ?

I guess this is the way you could do something like that

var http = require('http');
http.createServer(function (req, res) {
    if(req.method === 'GET' && req.path === '/'){
        // do stuff
    }
}).listen(8080, "127.0.0.1");