E-Zbox / news_app

This is an Express REST api application built on top Newscatcher (https://newscatcherapi.com/free-news-api) api

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

News App Backend πŸ“°

Table of Contents

Description

News App is a mini data-as-a-service project built on top of NewsCatcher API to make easier the process of using the services provided by NewsCatcher API.

NOTE This application is not affiliated in anyway to the NewsCatcher API or their developers. This is merely a side project.

Technologies Used πŸ‘©β€πŸ’»πŸ—

This project was built using:

  • NodeJS, Express.js
  • Axios (for fetching data)

Launching the Project πŸš€πŸš€

To be able to run this project on your local machine, make sure you have NodeJS installed on your computer.

Check for NodeJS

On your terminal, run the code below

npm --version
npx --version

Cloning and Installing dependencies βš™

On your terminal, run the code below

git clone https://github.com/E-Zbox/news_app.git

Once you have successfully cloned the repository, cd news_app on your terminal.

While in the root directory of the project, run the code below on your terminal

npm install

After installation, go to NewsCatcher API and setup an account if you are a new user, follow the steps provided on their page to create a unique API key.

Environment dependencies

Update your .env.development file in the root directories with your unique API key gotten from the NewsCatcher API.

Now, set your NODE_ENV variable on your terminal with this code

  • For Linux or mac OS users
export NODE_ENV=development
  • For Windows users
SET NODE_ENV=development

Running the code

Run the code below on your terminal

npm run dev

Testing the API πŸ§ͺ

On your browser or Postman, run the following code below to get news articles about "Elon Musk"

localhost:[[PORT]]/search?topic="Elon Musk"

DON'T FORGET TO INCLUDE THE API KEY PROVIDED BY NEWSCATCHER API IN YOUR HEADERS

Perform the operation below in your browser or Postman

...
{
headers: {
	"x-api-key": `[[YOUR_API_KEY]]`
	}
}

Phew.

Congratulations πŸŽ‰πŸΎ you successfully made your first request

Live Version of App

Screenshot of Live Project

Screenshot 1

Screenshot 2

Screenshot 3

Screenshot 4

Screenshot 5

Credits

NewsCatcher API

Author

Developed by Ononogbu Ebenezer

About

This is an Express REST api application built on top Newscatcher (https://newscatcherapi.com/free-news-api) api


Languages

Language:JavaScript 100.0%