<commit_before>//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');<commit_msg>Use middleware to intercept requests<commit_after>//Main server file
var express = require('express');

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

//Define our routes here.
var homeRoute = express.Router();
var adminRoute = express.Router();
var userRoute = express.Router();

// Add Route middleware. This will be invoked before each call
// to the home route. This is useful in intercepting the requests
// and processing the request before the route.

homeRoute.use(function(req, res, next){
	console.log("HOME-METHOD:" + req.method + " URL:" + req.url);
	next();
});

adminRoute.use(function(req, res, next){
	console.log("ADMIN-METHOD:" + req.method + " URL:" + req.url);
	next();
});

//Setup the routes
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");
});

//Add the routes to the application
app.use('/',homeRoute);
app.use('/admin', adminRoute);
app.use('/user', userRoute);

app.listen(4000);
console.log('Server running on port 4000');
{'fraction_non_alphanumeric': 0.18237547892720307, 'fraction_numerical': 0.006130268199233717, 'mean_word_length': 5.129107981220657, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1582687', 'n_tokens_mistral': 818, 'n_tokens_neox': 792, 'n_words': 248}