Advertisement
Guest User

Untitled

a guest
May 3rd, 2022
11
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. app.get('/', async (req, res) => {
  2.     let { data } = await axios('https://platprices.com/api.php?key=<apikey>&sale=2601&region=tr')
  3.     const gamesArr = data.game_discounts;
  4.  
  5.     let openCriticId = [];
  6.     for (let i of gamesArr) {
  7.         const { data } = axios(`https://api.opencritic.com/api/game/${i.OpenCriticID}`)
  8.         openCriticId = [...openCriticID, { data.name, data.mediansCore }];
  9.     }
  10.  
  11.     res.render('inicio', { gamesArr })
  12. })
  13.  
  14. OUTPUT:
  15.  
  16. openCriticId = [...openCriticID, { data.name, data.medianScore }];
  17.                                                ^
  18.  
  19. SyntaxError: Unexpected token '.'
  20.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement