Skip to main content

Posts

Showing posts with the label nestjs

Fetching Data from External API and Pass it to a Component in Next.js

Fetching data from an external API is a common task in modern web development. In this article, we will be showing how to use Next.js to fetch data from an external API and pass it to a component. Step 1 : First, let's start by creating a new Next.js project. You can do this by running the following command in your terminal: npx create-next-app my-app This will create a new Next.js project with the name "my-app" in a new folder with that name., Step 2 : Next, we will install the axios library, which is a popular library for making HTTP requests. You can install it by running the following command in your terminal: npm install axios Step 3 : Now, let's create a new component in our Next.js project. In this example, we will call it "Card". This component will be responsible for displa...