First get your own api key by sign up in weatherapi.com and use it in fetch request.
To host a project in localhost, you need to follow these steps:
- Open Command Prompt (CMD): You can do this by searching for "cmd" in the Windows search bar and clicking on the Command Prompt application.
- Navigate to Your Project Directory: Use the
cd
command to navigate to your project directory. For example, if your project is in a folder named "my-project" on your desktop, you would typecd Desktop\my-project
and press Enter. - Install Project Dependencies: Run the
npm install
command in the Command Prompt. This command will install all the dependencies listed in your project'spackage.json
file. Typenpm install
and press Enter. - Start the Project: After the installation is complete, you can start your project by running the
npm start
command. This command will start a development server and open your project in a web browser. Typenpm start
and press Enter.
Your project should now be hosted in localhost. You can access it by opening a web browser and navigating to http://localhost:3000
(or a different port if specified in your project).