What all can app.get in express be used for?

It can be used for

app.get('/', function(req, res){
  res.send('hello world');
});

which is to display in browser upon receiving request on Port defined.

What other uses are there of the command app.get?

app.get has two uses.

the first is using it as a route just like you showed, or even using multiple middlewares additionally to the route like in the following example:

var middleware = function(req, res, next) {
    //do something, then call the next() middleware.
    next();
}

app.get('/', middleware, function (req, res) {
   res.render('template');
});

but app.get can also be used together with app.set:

var appEnv = app.get('env'); //tells you the environment, development or production
var appPort = app.get('port'); //tells you the port the app runs on
console.log('app is running in ' + appEnv + ' environment and on port: ' + appPort);

app.set('any-string', 'any value'); //set custom app level value
var any_string = app.get('any-string'); //retrieve custom app level value
console.log('any_string = ' + any_string);

thats the uses for app.get i found so far,

have fun

jascha

In express app.get or app.post is used to define a route. Both of them work the same way. They accept two parameters

1) A string that defines the path of the route

2) A single or multiple callbacks.

app.get('/', function(req, res){
res.send('hello world');
});

What the above code does is it tells express that when a request is made on / endpoint it executes the code in the callback function. The function that you have defined just sends an html message

However there are lot's of different responses that you can send to the browser. They are enumerated in the guide