<commit_before>var libPath = require('path');

module.exports = function supportAngularHtml5(server) {
  var router = server.loopback.Router();

  router.all('/*', function(req, res, next) {
    var reqUrl = req.originalUrl;

    if (reqUrl.match(/^\/js\/.*/) !== null) {
      // static javascript resources, skip it
      next();
    } else if (reqUrl.match(/^\/views\/.*/)) {
      // static html view resources, skip it
      next();
    } else {
      // otherwise just gave the index.html for angular HTML5 mode support
      res.sendFile('client/public/index.html', { root: libPath.join(__dirname, '..', '..') });
    }
  });

  server.use(router);
};<commit_msg>Add more filter rules to meet requirement.<commit_after>var libPath = require('path');

module.exports = function supportAngularHtml5(server) {
  var router = server.loopback.Router();

  router.all('/*', function(req, res, next) {
    var reqUrl = req.originalUrl;

    if (reqUrl.match(/^\/js\/.*/) !== null) {
      // static javascript resources, skip it
      next();
    } else if (reqUrl.match(/^\/views\/.*/)) {
      // static html view resources, skip it
      next();
    } else if (reqUrl.match(/^\/img\/.*/)) {
      // static image resources, skip it
      next();
    } else if (reqUrl.match(/^\/page\/.*/)) {
      // static html resources, skip it
      next();
    } else if (reqUrl.match(/^\/api.*/)) {
      // loopback api root, skip it
      next();
    } else if (reqUrl.match(/^\/explorer.*/)) {
      // loopback explorer root, skip it
      next();
    } else {
      // otherwise just gave the index.html for angular HTML5 mode support
      res.sendFile('client/public/index.html', { root: libPath.join(__dirname, '..', '..') });
    }
  });

  server.use(router);
};
{'fraction_non_alphanumeric': 0.18640226628895185, 'fraction_numerical': 0.0022662889518413596, 'mean_word_length': 2.44921875, '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': '1986551', 'n_tokens_mistral': 561, 'n_tokens_neox': 547, 'n_words': 142}