<commit_before>import React from 'react';
import PropTypes from 'prop-types';
import axios from 'axios';

import Promo from '../components/promo.jsx';
import Feature from '../components/feature.jsx';
import Differential from '../components/differential.jsx';
import Carousel from '../components/carousel.jsx';

class ComponentSwitch extends React.Component {

  constructor(props) {
    super(props);

    this.state = {
      pageData: null
    };

    this.getPageData = this.getPageData.bind(this);
  }

  componentDidMount() {
    this.getPageData();
  }

  getPageData() {
    const urlParams = this.props.location;
    const pathname = urlParams.pathname;
    console.log(pathname);
    const requestedPage = pathname.replace('/', '');
    console.log(requestedPage);

    axios
    .get(`/_temp/${requestedPage}.json`,{
      urlData: urlParams
    })
    .then(res => {
      const data = res.data;
      console.log(data);

      this.setState({
        pageComponents: data.Content
      });
<commit_msg>Updating the pathname replace<commit_after>import React from 'react';
import PropTypes from 'prop-types';
import axios from 'axios';

import Promo from '../components/promo.jsx';
import Feature from '../components/feature.jsx';
import Differential from '../components/differential.jsx';
import Carousel from '../components/carousel.jsx';

class ComponentSwitch extends React.Component {

  constructor(props) {
    super(props);

    this.state = {
      pageData: null
    };

    this.getPageData = this.getPageData.bind(this);
  }

  componentDidMount() {
    this.getPageData();
  }

  getPageData() {
    const urlParams = this.props.location;
    const pathname = urlParams.pathname;
    console.log(pathname);
    const requestedPage = pathname.replace(/[\/]+/g, '');
    console.log(requestedPage);

    axios
    .get(`./_temp/${requestedPage}.json`,{
      urlData: urlParams
    })
    .then(res => {
      const data = res.data;
      console.log(data);

      this.setState({
        pageComponents: data.Content
      });

{'fraction_non_alphanumeric': 0.1380487804878049, 'fraction_numerical': 0.0, 'mean_word_length': 3.102, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '1344452', 'n_tokens_mistral': 632, 'n_tokens_neox': 617, 'n_words': 133}