<commit_before>(function(module) {
	"use strict";

	// express removal of routes
	var unmount = function (app, path) {
	    for (var i = 0, len = app.stack.length; i < len; ++i) {
	        if (app.stack[i].route && app.stack[i].route.path == path) {
	            app.stack.splice(i, 1);
	            return true;
	        };
	    }
	    return false;
	}

	var Plugin = {};

	function renderHomepage(req, res, next) {
		res.render('homepage', {});
	}

    Plugin.init = function(params, callback) {
    	var app = params.app,
			middleware = params.middleware,
			controllers = params.controllers;
			
    	// For some reason, the main / route cannot be overwritten without deleting it first
    	unmount(app, '/');

		app.get('/', params.middleware.buildHeader, renderHomepage);
		app.get('/api/home', function(req, res, next) {
			res.json({});
		});

		app.get('/forum', params.middleware.buildHeader, params.controllers.home);
		app.get('/api/forum', params.controllers.home);

		callback();
	};

    Plugin.addNavigation = function(header, callback) {
		header.navigation.push(
			{
				route: '/forum',
				class: '',<commit_msg>fixing router issue<commit_after>(function(module) {
	"use strict";

	// express removal of routes
	var unmount = function (app, path) {
	    for (var i = 0, len = app.stack.length; i < len; ++i) {
	        if (app.stack[i].route && app.stack[i].route.path == path) {
	            app.stack.splice(i, 1);
	            return true;
	        };
	    }
	    return false;
	}

	var Plugin = {};

	function renderHomepage(req, res, next) {
		res.render('homepage', {});
	}

    Plugin.init = function(params, callback) {
    	var app = params.router,
			middleware = params.middleware,
			controllers = params.controllers;
			
    	// For some reason, the main / route cannot be overwritten without deleting it first
    	unmount(app, '/');

		app.get('/', params.middleware.buildHeader, renderHomepage);
		app.get('/api/home', function(req, res, next) {
			res.json({});
		});

		app.get('/forum', params.middleware.buildHeader, params.controllers.home);
		app.get('/api/forum', params.controllers.home);

		callback();
	};

    Plugin.addNavigation = function(header, callback) {
		header.navigation.push(
			{
				route: '/forum',
				class: '',
{'fraction_non_alphanumeric': 0.16073781291172595, 'fraction_numerical': 0.001756697408871322, 'mean_word_length': 2.815745393634841, 'pattern_counts': {'":': 0, '<': 5, '<?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': '5339189', 'n_tokens_mistral': 824, 'n_tokens_neox': 725, 'n_words': 170}