<commit_before>import * as express from 'express';
import * as bodyParser from 'body-parser';
import * as logger from './logger';
import * as routes from './routes';
import * as web from './web';
import * as auth from './auth';
import { resolve } from 'path';

export let router: express.Router = express.Router();

function index(req: express.Request, res: express.Response): void {
  return res.status(200).sendFile(resolve(__dirname, 'app/index.html'));
}

router.use(bodyParser.json({ limit: '100Mb' }));
router.use(auth.middleware);
router.use(logger.middleware);

router.use('/css', express.static(resolve(__dirname, 'app/css'), { index: false }));
router.use('/js', express.static(resolve(__dirname, 'app/js'), { index: false }));
router.use('/images', express.static(resolve(__dirname, 'app/images'), { index: false }));
router.use('/css/fonts', express.static(resolve(__dirname, 'app/fonts'), { index: false }));

router.get('/api/package/get-random', web.getRandomPackages);
router.get('/api/package/search', web.searchPackages);
router.post('/api/user/login', web.login);
router.get('/user/login', index);

router.put(/\/\-\/user\/org\.couchdb\.user\:(.*)/, routes.doAuth);
router.delete('/-/user/token/:token', routes.logout);
router.get('/:package/:version?', auth.hasAccess, routes.getPackage);
router.get('/:package/-/:tarball', auth.hasAccess, routes.getTarball);
router.get('/-/v1/search', auth.hasAccess, routes.search);
router.put('/:package/:_rev?/:revision?', auth.hasAccess, routes.publishPackage);

router.all('/*', index);<commit_msg>fix(index.html): fix path to index.html<commit_after>import * as express from 'express';
import * as bodyParser from 'body-parser';
import * as logger from './logger';
import * as routes from './routes';
import * as web from './web';
import * as auth from './auth';
import { resolve } from 'path';

export let router: express.Router = express.Router();

function index(req: express.Request, res: express.Response): void {
  return res.status(200).sendFile(resolve(__dirname, '../app/index.html'));
}

router.use(bodyParser.json({ limit: '100Mb' }));
router.use(auth.middleware);
router.use(logger.middleware);

router.use('/css', express.static(resolve(__dirname, 'app/css'), { index: false }));
router.use('/js', express.static(resolve(__dirname, 'app/js'), { index: false }));
router.use('/images', express.static(resolve(__dirname, 'app/images'), { index: false }));
router.use('/css/fonts', express.static(resolve(__dirname, 'app/fonts'), { index: false }));

router.get('/api/package/get-random', web.getRandomPackages);
router.get('/api/package/search', web.searchPackages);
router.post('/api/user/login', web.login);
router.get('/user/login', index);

router.put(/\/\-\/user\/org\.couchdb\.user\:(.*)/, routes.doAuth);
router.delete('/-/user/token/:token', routes.logout);
router.get('/:package/:version?', auth.hasAccess, routes.getPackage);
router.get('/:package/-/:tarball', auth.hasAccess, routes.getTarball);
router.get('/-/v1/search', auth.hasAccess, routes.search);
router.put('/:package/:_rev?/:revision?', auth.hasAccess, routes.publishPackage);

router.all('/*', index);
{'fraction_non_alphanumeric': 0.2149443561208267, 'fraction_numerical': 0.004451510333863275, 'mean_word_length': 5.473251028806584, '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': '6841407', 'n_tokens_mistral': 1004, 'n_tokens_neox': 995, 'n_words': 201}