<commit_before>const axios = require('axios');

const recipes = {
  getRecipeList: (req, res, next) => {
    console.log('request body data', req.body.data);
    const options = {
      headers: { "X-Mashape-Key": "<KEY>" },
      params: { instructionsRequired: false, offset: 0, query: req.body.data }
    }
    axios.get('https://spoonacular-recipe-food-nutrition-v1.p.mashape.com/recipes/search', options)
      .then(resp => {
        res.json(resp.data);
      })
      .catch(err => {
        console.log('Error: ', err);
      })
  },
  getRecipe: (req, res, next) => {
    const options = {
      headers: {
        "X-Mashape-Key": "<KEY>"
      }
    }

    return axios.get(`https://spoonacular-recipe-food-nutrition-v1.p.mashape.com/food/products/${id}`, options)
  }
}

module.exports = recipes;<commit_msg>updated recipe controller for recipe api<commit_after>const axios = require('axios');

const recipes = {
  getRecipeList: (req, res, next) => {
    console.log('request body data', req.body.data);
    const options = {
      headers: { "X-Mashape-Key": "<KEY>" },
      params: { instructionsRequired: false, offset: 0, query: req.body.data }
    }
    axios.get('https://spoonacular-recipe-food-nutrition-v1.p.mashape.com/recipes/search', options)
      .then(resp => {
        console.log(resp.data[0])
        console.log(resp.data[0].imageUrls)
        res.json(resp.data);
      })
      .catch(err => {
        console.log('Error: ', err);
      })
  },
  getRecipe: (req, res, next) => {
    const options = {
      headers: {
        "X-Mashape-Key": "<KEY>"
      }
    }

    axios.get(`https://spoonacular-recipe-food-nutrition-v1.p.mashape.com/recipes/${req.body.id}/analyzedInstructions`, options)
      .then( resp => {
        res.json(resp.data);
      })
  }
}

module.exports = recipes;
{'fraction_non_alphanumeric': 0.18027397260273972, 'fraction_numerical': 0.004383561643835616, 'mean_word_length': 2.573385518590998, 'pattern_counts': {'":': 4, '<': 7, '<?xml version=': 0, '>': 16, 'https://': 4, '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': '6257253', 'n_tokens_mistral': 645, 'n_tokens_neox': 637, 'n_words': 100}