app.get(path,
callback [, callback ...])
Previous
Next
Home
Routes HTTP GET requests to the specified path with the
specified callback functions.
Exmaple
app.get('/', function (req, res) {
res.send('Hello
World');
});
app.get('/welcome', function (req, res) {
res.send('Hey
user!!! Good Morning....:)');
});
index.js
var express = require('express') var app = express() app.get('/', function (req, res) { res.send('Hello World'); }); app.get('/welcome', function (req, res) { res.send('Hey user!!! Good Morning....:)'); }); app.listen(3000, () => {console.log("Application started in port 3000")});
No comments:
Post a Comment