-
Install node then open the terminal in same folder of project
-
run npm init (i.e. it will install the dependecies)
-
then run nodemon server.js or node server.js
-
go to http://localhost://5000/getTimeNews to se the result
-
npm init to initilize the app
-
install Express, axios, body-parser, nodemon
-
create basic app and define port i.e 5000 and import axios and bodyparser
-
register and get a API key for Time.com from NewsAPI.org then
-
make axios call to provided API
-
sotre the "data" field from the response in data[]
-
use next-generation destructuring to extract the "title" and "url" fields and store them into allnews[]
-
use res.json() to send the data for Frontend