Posts

Showing posts from September, 2020

Building a news app in react-native using Expo and Express on the Node.js server

Image
The blog post is divided into two sections, in first we will explore creating a basic server for our application. This server uses basic web scraping techniques to retrieve data from a trusted news portal. We are only scraping article title and article link, but can expand feature to include more data as well. In the next section, we will create an a cross-platform app from scratch for both iOS and Android. This app is going to retrieve the data from the server we created in Section 1 and display to the user. Section 1 Building a server : npm install --save express request-promise cheerio Add these dependencies to a new file newsAPI.js. const express = require("express"); const app = express(); const rp = require("request-promise"); const $ = require("cheerio"); app.use(express.json()); app.get("/", (req, res) => {   res.send("Hello !!!"); }); const port = process.env.PORT || 3000; app.listen(port, () => console.log(`http://localh