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
Post a Comment