DEV Community

Build a news app with Nodejs , Express , EJS and NewsApi

atultyagi612 on March 17, 2021

Today we are going to develop a simple News app with the help of NodeJS , Express , EJS and bootstrap. There are going to be 2 main features in ...
Collapse
 
thom4s profile image
Thomas • Edited

Cool article ! thanks
One or two things :

(For me) the tag 'article.content' (in news view) seems to return some tags (ul li) that breaks the design.

You should add some details for the different steps. For exemple : once the step "Application" written, the server throw an error... because the next step is not written yet. It's important if we don't want to search and waste times :)

cheers

Collapse
 
atultyagi612 profile image
atultyagi612

Issue resolved by just replacing 'article.content' to 'articel.content.replace(/<[^>]+>/g, '') '

Thanks for informing😊

Collapse
 
qsrahman profile image
Sami ur Rahman

Good one!
However there is no need to install body-parser as express.js include it. use instead

app.use(express.urlencoded({ extended: true }));
Enter fullscreen mode Exit fullscreen mode
Collapse
 
atultyagi612 profile image
atultyagi612 • Edited

Thanks for the suggestion bro.

Collapse
 
felizk profile image
Jacob Korsgaard

Neat! Thanks! :)

I noticed you put your actual API key in the example rather than the template text "YOUR_API" you mentioned.

Collapse
 
atultyagi612 profile image
atultyagi612

Thanks for informing bro🙌

Collapse
 
vicky1415 profile image
Vicky

thanks man for providing this amazing information. I have used a NewsData.io NewsAPI to integrate news data with my website. can you tell me more about this API??

Collapse
 
alokydv001 profile image
Alok kumar

thanks bro

Collapse
 
andrewbaisden profile image
Andrew Baisden • Edited

Cool article and project!

Collapse
 
railwaygundora profile image
RailwayGunDora

Hi Man, You are Super cool for sharing this. We are truly thankful!

Collapse
 
iamrathnak profile image
Rathna Kumar K

Join me at #CCDaysOnline to attend exciting sessions on Serverless & DevOps on 24 & 25 March 2021. For registration and event details: t.co/z6oTSV1qgq