Skip to content
Discussion options

You must be logged in to vote

I did it with axios and it worked. Thread can be closed.

const axios = require('axios');

async function handler(req, res) {
  const response = await axios.get('https://api.github.com/search/repositories?q=tetris');
  if (response) {
    res.json(response.data);
  } else {
    res.json({});
  }
}

export default handler;

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by imgyf
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants