<commit_before>const express = require('express');
// const ab                   = require('express-ab');
const bp = require('body-parser');
const markdown = require('./markdown');
const es = require('express-sanitizer');

const { getPrismicAPI, getSingle, getPrismic, previewController } = require('./prismic');

const { getIntegrations, getIntegration } = require('./controllers/integrations');
const contactCtrl = require('./controllers/contactCtrl');
const getformCtrl = require('./controllers/getformCtrl');
const hsblockedCtrl = require('./controllers/hsblockedCtrl');
const hsconvertedCtrl = require('./controllers/hsconvertedCtrl');
const newsletterCtrl = require('./controllers/newsletterCtrl');
const trustedPartnersCtrl = require('./controllers/trustedPartnersCtrl');
const viewCtrl = require('./controllers/viewCtrl');

module.exports = {
  router: app => {

    // var abTestTest = ab.test('pricing-test', {id: 'MRClmJX_QEakg3kJs2jH9g'});

    app.options("/api/*", function(_, res){
      res.header('Access-Control-Allow-Origin', '*');
      res.header('Access-Control-Allow-Methods', 'POST,OPTIONS');
      res.header('Access-Control-Allow-Headers',
        'Content-Type, Authorization, Content-Length, X-Requested-With');
      res.removeHeader('Content-Security-Policy');
      res.removeHeader('X-Content-Security-Policy');
      res.removeHeader('X-WebKit-CSP');
      res.send(200);
    });

    return new express.Router()
    // .get('/css/styles.min.css', abTestTest(null, 0.50), function(_, res) {
    //   res.sendFile('/css/styles.min.css', {root: './_site'});
    // })
    // .get('/css/styles.min.css', abTestTest(null, 0.50), function(_, res) {
    //   res.sendFile('/css/styles.test.min.css', {root: './_site'});
    // });

    // normal pages
    .get('/', (_, res) => res.render('index'))

    .get('/about', (_, res) => res.redirect('https://ionic.io/about'))
    .get('/advisory', (_, res) => res.render('products/advisory'))
    .get('/appflow', (_, res) => res.render('products/appflow'))

    .get('/books/evaluating-ionic-for-enterprise', (_, res) => res.redirect('https://go.ionicframework.com/enterprise-eval-guide'))
    .get('/books/hybrid-v(s)?-native', (_, res) => res.redirect('https://go.ionicframework.com/hybrid-vs-native-guide'))
    .get('/books/hybrid-vs-native/preview', (_, res) => res.redirect('https://go.ionicframework.com/hybrid-vs-native-guide'))
    .get('/books/rethinking-low-code', (_, res) => res.redirect('https://ionic.io'))

    .get('/code-of-conduct', (_, res) => markdown(res, 'code-of-conduct'))
    .get('/community', getPrismicAPI, (req, res, next) => getSingle(req, res, next, 'framework_community', 'community'))
    .get('/contact', (_, res) => res.render('contact'))
    .get('/contributors', (_, res) => res.render('contributors'))
    .get('/covid-19', (_, res) => markdown(res, 'corona'))
    .get('/creator', (_, res) => res.render('creator/index'))
    .get('/creator/support', (_, res) => res.render('creator/support'))
    .get('/customers', (_, res) => res.redirect('https://ionic.io/customers'))
    .get('/demo', (_, res) => res.redirect('https://ionic.io/demo'))
    .get('/developers', (_, res) => res.render('developers'))
    .get('/ds', (_, res) => res.render('ds'))

    .get('/early-access', (_, res) => res.render('early-access'))
    .get('/enterprise', (_, res) => res.render('enterprise/index'))
    .get('/enterprise/auth-connect', (_, res) => res.redirect('https://ionic.io/products/auth-connect'))
    .get('/enterprise/contact', (_, res) => res.redirect('https://ionic.io/contact/sales'))
    .get('/enterprise/identity-vault', (_, res) => res.redirect('https://ionic.io/products/identity-vault'))
    .get('/enterprise/offline-storage', (_, res) => res.redirect('https://ionic.io/products/offline-storage'))
    .get('/enterprise/platform', (_, res) => res.render('enterprise/platform'))

    .get('/enterprise/solutions', (_, res) => res.render('enterprise/solutions/index'))
    .get('/enterprise/solutions/cross-platform', (_, res) => res.render('enterprise/solutions/cross-platform'))

    .get('/enterprise/strategy-session', (_, res) => res.render('enterprise/strategy-session'))
    .get('/enterprise/support', (_, res) => res.render('enterprise/support'))
    .get('/enterprise/training', (_, res) => res.render('enterprise/training'))
    .get('/enterprise/why-ionic', (_, res) => res.redirect('https://ionic.io/why-ionic'))
    .get('/enterprise-license-agreement', (_, res) => markdown(res, 'enterprise-license-agreement'))
    .get('/framework', (_, res) => res.render('framework'))
    .get('/getting-started', (_, res) => res.render('getting-started'))
    .get('/getting-started-with-ionic-vue', (_, res) => res.render('getting-started-with-ionic-vue'))

    .get('/go/pwa-architects-guide', (_, res) =>
      res.render('go/pwa-architects-guide/index'))
    .post('/go/pwa-architects-guide', (_, res) =>
      res.render('go/pwa-architects-guide/thank-you'))
    .get('/go/pwa-architects-guide/thank-you', (_, res) =>
      res.render('go/pwa-architects-guide/thank-you'))

    .get('/go/why-hybrid', (_, res) => res.render('go/why-hybrid/index'))<commit_msg>feat(router): Redirect enterprise page<commit_after>const express = require('express');
// const ab                   = require('express-ab');
const bp = require('body-parser');
const markdown = require('./markdown');
const es = require('express-sanitizer');

const { getPrismicAPI, getSingle, getPrismic, previewController } = require('./prismic');

const { getIntegrations, getIntegration } = require('./controllers/integrations');
const contactCtrl = require('./controllers/contactCtrl');
const getformCtrl = require('./controllers/getformCtrl');
const hsblockedCtrl = require('./controllers/hsblockedCtrl');
const hsconvertedCtrl = require('./controllers/hsconvertedCtrl');
const newsletterCtrl = require('./controllers/newsletterCtrl');
const trustedPartnersCtrl = require('./controllers/trustedPartnersCtrl');
const viewCtrl = require('./controllers/viewCtrl');

module.exports = {
  router: app => {

    // var abTestTest = ab.test('pricing-test', {id: 'MRClmJX_QEakg3kJs2jH9g'});

    app.options("/api/*", function(_, res){
      res.header('Access-Control-Allow-Origin', '*');
      res.header('Access-Control-Allow-Methods', 'POST,OPTIONS');
      res.header('Access-Control-Allow-Headers',
        'Content-Type, Authorization, Content-Length, X-Requested-With');
      res.removeHeader('Content-Security-Policy');
      res.removeHeader('X-Content-Security-Policy');
      res.removeHeader('X-WebKit-CSP');
      res.send(200);
    });

    return new express.Router()
    // .get('/css/styles.min.css', abTestTest(null, 0.50), function(_, res) {
    //   res.sendFile('/css/styles.min.css', {root: './_site'});
    // })
    // .get('/css/styles.min.css', abTestTest(null, 0.50), function(_, res) {
    //   res.sendFile('/css/styles.test.min.css', {root: './_site'});
    // });

    // normal pages
    .get('/', (_, res) => res.render('index'))

    .get('/about', (_, res) => res.redirect('https://ionic.io/about'))
    .get('/advisory', (_, res) => res.render('products/advisory'))
    .get('/appflow', (_, res) => res.render('products/appflow'))

    .get('/books/evaluating-ionic-for-enterprise', (_, res) => res.redirect('https://go.ionicframework.com/enterprise-eval-guide'))
    .get('/books/hybrid-v(s)?-native', (_, res) => res.redirect('https://go.ionicframework.com/hybrid-vs-native-guide'))
    .get('/books/hybrid-vs-native/preview', (_, res) => res.redirect('https://go.ionicframework.com/hybrid-vs-native-guide'))
    .get('/books/rethinking-low-code', (_, res) => res.redirect('https://ionic.io'))

    .get('/code-of-conduct', (_, res) => markdown(res, 'code-of-conduct'))
    .get('/community', getPrismicAPI, (req, res, next) => getSingle(req, res, next, 'framework_community', 'community'))
    .get('/contact', (_, res) => res.render('contact'))
    .get('/contributors', (_, res) => res.render('contributors'))
    .get('/covid-19', (_, res) => markdown(res, 'corona'))
    .get('/creator', (_, res) => res.render('creator/index'))
    .get('/creator/support', (_, res) => res.render('creator/support'))
    .get('/customers', (_, res) => res.redirect('https://ionic.io/customers'))
    .get('/demo', (_, res) => res.redirect('https://ionic.io/demo'))
    .get('/developers', (_, res) => res.render('developers'))
    .get('/ds', (_, res) => res.render('ds'))

    .get('/early-access', (_, res) => res.render('early-access'))
    .get('/enterprise', (_, res) => res.redirect('https://ionic.io/enterprise'))
    .get('/enterprise/auth-connect', (_, res) => res.redirect('https://ionic.io/products/auth-connect'))
    .get('/enterprise/contact', (_, res) => res.redirect('https://ionic.io/contact/sales'))
    .get('/enterprise/identity-vault', (_, res) => res.redirect('https://ionic.io/products/identity-vault'))
    .get('/enterprise/offline-storage', (_, res) => res.redirect('https://ionic.io/products/offline-storage'))
    .get('/enterprise/platform', (_, res) => res.render('enterprise/platform'))

    .get('/enterprise/solutions', (_, res) => res.render('enterprise/solutions/index'))
    .get('/enterprise/solutions/cross-platform', (_, res) => res.render('enterprise/solutions/cross-platform'))

    .get('/enterprise/strategy-session', (_, res) => res.render('enterprise/strategy-session'))
    .get('/enterprise/support', (_, res) => res.render('enterprise/support'))
    .get('/enterprise/training', (_, res) => res.render('enterprise/training'))
    .get('/enterprise/why-ionic', (_, res) => res.redirect('https://ionic.io/why-ionic'))
    .get('/enterprise-license-agreement', (_, res) => markdown(res, 'enterprise-license-agreement'))
    .get('/framework', (_, res) => res.render('framework'))
    .get('/getting-started', (_, res) => res.render('getting-started'))
    .get('/getting-started-with-ionic-vue', (_, res) => res.render('getting-started-with-ionic-vue'))

    .get('/go/pwa-architects-guide', (_, res) =>
      res.render('go/pwa-architects-guide/index'))
    .post('/go/pwa-architects-guide', (_, res) =>
      res.render('go/pwa-architects-guide/thank-you'))
    .get('/go/pwa-architects-guide/thank-you', (_, res) =>
      res.render('go/pwa-architects-guide/thank-you'))

    .get('/go/why-hybrid', (_, res) => res.render('go/why-hybrid/index'))
{'fraction_non_alphanumeric': 0.23178234954816382, 'fraction_numerical': 0.0026917900403768506, 'mean_word_length': 3.9942390782525203, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 85, 'https://': 25, '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': '1407781', 'n_tokens_mistral': 3523, 'n_tokens_neox': 3349, 'n_words': 442}