<commit_before>// @flow
/**
 * Part of GDL gdl-frontend.
 * Copyright (C) 2017 GDL
 * 
 * See LICENSE
 */
const nextRoutes = require('next-routes');
const env = require('./env');

const routes = nextRoutes();

if (env.IS_PROD) {
  // In prod we want the about page to the landing page
  routes.add('about', '/', 'about/index');
  routes.add('books', '/books', 'index');
} else {
  // in other environments we want the books page to be the landing page
  routes.add('books', '/:lang?', 'index');
  routes.add('about');
}

// Book grid by level (we only allow a single digit for level, so no + in the regex)
routes.add('level', '/:lang/books/level:level(\\d)', 'books/more');
// Book grid for new books
routes.add('new', '/:lang/books/new', 'books/more');

// Book page
routes.add('book', '/:lang/books/:id(\\d+)/:chapter(\\d+)?', 'books/index');
routes.add('bookByNew', '/:lang/books/new/:id(\\d+)', 'books/index');
// We only allow a single digit in the level, so no + in the regex
routes.add(
  'bookByLevel',
  '/:lang/books/level:level(\\d)/:id(\\d+)',
  'books/index',
);

// About the global digital library
routes.add(
  'global-digital-library',
  'about/global-digital-library',
  'about/global-digital-library',
);

module.exports = routes;<commit_msg>In PROD we only define about routes<commit_after>// @flow
/**
 * Part of GDL gdl-frontend.
 * Copyright (C) 2017 GDL
 * 
 * See LICENSE
 */
const nextRoutes = require('next-routes');
const env = require('./env');

const routes = nextRoutes();

// About the global digital library
routes.add(
  'global-digital-library',
  'about/global-digital-library',
  'about/global-digital-library',
);

// Locking down all other sites except the two about pages in PROD
if (env.IS_PROD) {
  routes.add('about', '/', 'about/index');
} else {
  routes.add('about');
  // in other environments we want the books page to be the landing page
  routes.add('books', '/:lang?', 'index');
  // Book grid by level (we only allow a single digit for level, so no + in the regex)
  routes.add('level', '/:lang/books/level:level(\\d)', 'books/more');
  // Book grid for new books
  routes.add('new', '/:lang/books/new', 'books/more');

  // Book page
  routes.add('book', '/:lang/books/:id(\\d+)/:chapter(\\d+)?', 'books/index');
  routes.add('bookByNew', '/:lang/books/new/:id(\\d+)', 'books/index');
  // We only allow a single digit in the level, so no + in the regex
  routes.add(
    'bookByLevel',
    '/:lang/books/level:level(\\d)/:id(\\d+)',
    'books/index',
  );
}

module.exports = routes;
{'fraction_non_alphanumeric': 0.20055161544523248, 'fraction_numerical': 0.0031520882584712374, 'mean_word_length': 3.583032490974729, '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': '6660144', 'n_tokens_mistral': 879, 'n_tokens_neox': 883, 'n_words': 247}