express - App.get() in Node.JS -


using express can call function get() :

var app = express();  app.get('/',function(req,res){     // stuff }) 

what equivalent in node.js ? how can same thing without express ?

i guess way that

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

Comments

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

c++ - qgraphicsview horizontal scrolling always has a vertical delta -