//Main server file
var express = require('express');

//Created a express applicatiom
var app = express();

var homeRoute = express.Router();
var adminRoute = express.Router();
var userRoute = express.Router();

homeRoute.get('/', function(req, res){
	res.send("You have reached the home page");
});

homeRoute.get('/login', function(req, res){
	res.send("You have reached the login page");
});

homeRoute.get('/about', function(req, res){
	res.send("You have reached the About page");
});

adminRoute.get('/', function(req, res){
	res.send("You have reached admin page");
});

adminRoute.get('/projects', function(req, res){
	res.send("You have reached admin's Projects page");
});

userRoute.get('/', function(req, res){
	res.send("You have reached user page");
});

userRoute.get('/projects', function(req, res){
	res.send("You have reached user's Projects page");
});

app.use('/',homeRoute);
app.use('/admin', adminRoute);
app.use('/user', userRoute);

app.listen(4000);
console.log('Server running on port 4000');
@@ -101,16 +101,42 @@
 ess();%0A%0A
+//Define our routes here.%0A
 var home
@@ -227,24 +227,457 @@
 .Router();%0A%0A
+// Add Route middleware. This will be invoked before each call%0A// to the home route. This is useful in intercepting the requests%0A// and processing the request before the route.%0A%0AhomeRoute.use(function(req, res, next)%7B%0A%09console.log(%22HOME-METHOD:%22 + req.method + %22 URL:%22 + req.url);%0A%09next();%0A%7D);%0A%0AadminRoute.use(function(req, res, next)%7B%0A%09console.log(%22ADMIN-METHOD:%22 + req.method + %22 URL:%22 + req.url);%0A%09next();%0A%7D);%0A%0A//Setup the routes%0A
 homeRoute.ge
@@ -1321,24 +1321,60 @@
 age%22);%0A%7D);%0A%0A
+//Add the routes to the application%0A
 app.use('/',

Use middleware to intercept requests