Build News Website With Node.js, Express & EJS - WP Rest API

Поделиться
HTML-код
  • Опубликовано: 17 дек 2024

Комментарии •

  • @surajshivan7758
    @surajshivan7758 4 года назад +1

    i tried with the news api. its working..............really awesome man......hats off to ur explaination

    • @RaddyDev
      @RaddyDev  4 года назад +1

      Glad to hear that! Thank you for letting me know 😋

  • @RaddyDev
    @RaddyDev  4 года назад +6

    If you want to know how to display data from the NewsAPI I just updated the article. Link in the description
    Update: Body-parser is no longer required as it's part of Express.
    Use this:
    app.use(express.urlencoded({extended: true}));
    Instead of:
    app.use(bodyParser.urlencoded({ extended: false }));

    • @RaddyDev
      @RaddyDev  3 года назад

      @Flame Fox C:\users\flame and then the file seems fine to me. You can go do that in any folder and that's where your project will be created

  • @puranjayyadav8061
    @puranjayyadav8061 4 года назад +7

    Woww dude. Really appreciate the work . Gonna add this to my project list

    • @RaddyDev
      @RaddyDev  4 года назад +1

      I appreciate the comment! Thank you

  • @fluffymaverick
    @fluffymaverick 3 года назад

    The real OG of NodeJS RaddyTheBrand 🔥🔥🔥. Thanks for this.

    • @RaddyDev
      @RaddyDev  3 года назад

      Haha, thank you! Happy Halloween, Alvin!

  • @Cartneymusic
    @Cartneymusic Год назад

    I am happy to have found a well-explained and above all well-ordered tutorial in the routing and inclusion of js code in html phase. A big thanks!

  • @InnovatePersonality
    @InnovatePersonality 4 года назад +2

    It is interesting from start to end. Thumbs up

  • @ntigirishari
    @ntigirishari 3 года назад +2

    Woow!! Buddy, thank you :-) I am gonna add some bootstrap, use another API, and add some more styling and make it a project for my portfolio. Thanks again!

    • @RaddyDev
      @RaddyDev  3 года назад +1

      Sounds great! Feel free to share the link, it would be awesome to see what you come up with

    • @ntigirishari
      @ntigirishari 3 года назад

      @@RaddyDev of course!!😀

    • @lazartutulic7577
      @lazartutulic7577 3 года назад

      @@ntigirishari And wheres the link? ;P

  • @vandanauniyal2114
    @vandanauniyal2114 4 месяца назад

    Thankyou for such amazing projects. Have learned so many things from you.

  • @twn_serenity
    @twn_serenity 3 года назад +1

    Thank you so much for this exceptional video!! Subscribed and will be waiting for some good content in the future!

    • @RaddyDev
      @RaddyDev  3 года назад

      Thanks for watching and the sub, Wei-Ning!

  • @UsmanAhmed714
    @UsmanAhmed714 2 года назад

    Love...! specially for choosing this topic

  • @konscomputertutorials7473
    @konscomputertutorials7473 Год назад +1

    Thanks for the quality tutorial it really healped

    • @RaddyDev
      @RaddyDev  Год назад +1

      Glad to hear that!

  • @TheMicpen
    @TheMicpen 2 года назад +1

    Thank you very much for sharing !

    • @RaddyDev
      @RaddyDev  2 года назад

      No problem, I hope that you enjoyed it

  • @coincoinfpv9503
    @coincoinfpv9503 3 года назад +1

    Super! That was a great tutorial! Thanks a lot :)

  • @TheNamesJT
    @TheNamesJT 2 года назад +3

    Can you make a 1 to 2 hour video on ejs, node, express and use local storage while also use api data? also would be really awesome if at the end of the video you would show how to deploy the site.

    • @RaddyDev
      @RaddyDev  2 года назад +4

      I will try to think of something. I need to see what free API's are out there available for everyone

  • @HomeEntertainment-f4y
    @HomeEntertainment-f4y 3 месяца назад

    Thank you For posting such an informative video. i was able to create my own Web App with bare minimum knowledge of Node. the step by step instructions were very Helpful

  • @Gui.castro
    @Gui.castro 3 года назад

    AWESOME! Thanks for this tutorial and all explanation!

    • @RaddyDev
      @RaddyDev  3 года назад

      Thank you, Guiherme!

  • @girlingame518
    @girlingame518 4 года назад +1

    happy to learn from you , very thanks for this great tutorial

    • @RaddyDev
      @RaddyDev  4 года назад

      Thank you and I am glad that you found it useful 👊🦍

  • @5tevend
    @5tevend 3 года назад

    adding the route on 17:20 didn't seem to work for me, i tried looking through SO and found a lot of different answers requiring module exports, can we not just use `app.get('/', (req,res) => res.render('news');` to render the news.ejs as our home route ?

    • @RaddyDev
      @RaddyDev  3 года назад

      I've got the code on my blog and github if you want to reference it. And to answer your question, yes you can do

  • @NikhilDongre-lb5wu
    @NikhilDongre-lb5wu 7 месяцев назад +1

    How can we deploy this on netlify or maybe on vercel ?

  • @prateekgowda7653
    @prateekgowda7653 4 года назад

    Brilliant. Keep up the good work.

  • @webtutorials4279
    @webtutorials4279 2 года назад

    Great Video Raddy! A small issue is that my view did not load until I changed './src/views' to './src/views/partials' at 17:40 on Line No.13. Can you let us know why yours loads up ?

    • @RaddyDev
      @RaddyDev  2 года назад

      On that screen the "news.ejs" file appears to look like it's inside the "partials" folder, but it's actually not. It's inside the "views" folder. I wounder if that could be it?

  • @claarkkkm
    @claarkkkm 4 года назад +1

    Well said tutorial, thank you! I hope you'll be big soon :)

  • @vishwajeetpawar3009
    @vishwajeetpawar3009 2 года назад +1

    can you make tutorial where we are using two or more data bases and API as well Please !! Surely Subscribed for your great teaching !!-

    • @RaddyDev
      @RaddyDev  2 года назад

      I need to think of something. Thanks for the kind words and the sub!

  • @tyrone12q
    @tyrone12q 2 года назад +1

    I want instead of from website api, i want to get the data from a file in public folder or somewhere else.

    • @RaddyDev
      @RaddyDev  2 года назад

      The process would be the same. Just grab the file from your server instead. If it's a json file you could do something like mywebsite dot com/myfile.json

  • @emanueltejadacoste2250
    @emanueltejadacoste2250 4 года назад

    Amazing, this channel is going to bring a lot of content i know , i will share with mu friends !

    • @RaddyDev
      @RaddyDev  4 года назад +1

      That would be awesome! Thank you very much for watching and the comment!

  • @haardpatel4242
    @haardpatel4242 3 года назад

    I used newsAPI then at 33:35 what should I type in ejs. Becz it is giving me error that articles.forEach() not defined ???????????????????????

    • @RaddyDev
      @RaddyDev  3 года назад

      Click the link in the description. I have an example of the newsAPI at the bottom

    • @nuraiutegen7411
      @nuraiutegen7411 3 года назад

      @@RaddyDev where is it ???i cant find it. i have the same problem and cant solve it

    • @RaddyDev
      @RaddyDev  3 года назад

      Scroll down to the RUclips questions section
      raddy.co.uk/blog/build-news-website-with-node-js-express-ejs-wp-rest-api/

  • @mvrkkautilya
    @mvrkkautilya 3 года назад +2

    it is saying forEach is not an function in ejs ...... how to solve it😥😥😥

    • @RaddyDev
      @RaddyDev  3 года назад

      Check the data that you are passing. forEach is an array method

  • @anujupadhyay10
    @anujupadhyay10 2 года назад +1

    which is the recommended ejs plugin for vscode?

    • @RaddyDev
      @RaddyDev  Год назад +1

      EJS Language Support 👌

  • @GreenOnion854
    @GreenOnion854 4 года назад +2

    Can you implement a login/register/password reset features from there ? so you can add a fav section for articles. It will be huge !

    • @RaddyDev
      @RaddyDev  4 года назад +1

      The Login/Register and password reset is definitely something that I will be doing. I am just trying to do everything step by step and we'll get there soon. Fav section is a good idea actually. Thank you for watching and thanks for your comment!

    • @GreenOnion854
      @GreenOnion854 4 года назад +1

      @@RaddyDev thanks to you. I'm trying to fetch an API from rapidAPI but it seems that it works in a different way. Quite confusing

    • @RaddyDev
      @RaddyDev  4 года назад

      I would assume that the names and the object trees are slightly different. You could console log the data and then start selecting the data that you need with the dot notation. If you are getting a JSON object it should be more or less the same

  • @enginb3818
    @enginb3818 3 года назад

    Appreciated, very brilliant project. I really love it thank you.

    • @RaddyDev
      @RaddyDev  3 года назад

      Glad that you liked it, Engin! Thank you!

  • @hardikmistry1661
    @hardikmistry1661 3 года назад

    great video sir nice content nicely explained every thing, that's it all I want

    • @RaddyDev
      @RaddyDev  3 года назад +1

      Glad that you found it helpful, Hardik. Thank you for watching!

  • @godpower7941
    @godpower7941 3 года назад

    im stuck att 33:39, being told articles.foreach is not a function.

    • @RaddyDev
      @RaddyDev  3 года назад

      Hi, you can reference the code here: raddy.co.uk/blog/build-news-website-with-node-js-express-ejs-wp-rest-api/

    • @RaddyDev
      @RaddyDev  3 года назад

      Let me know if you are struggling to figure it out. I'll try to help tomorrow

    • @bieberpraba2233
      @bieberpraba2233 3 года назад

      @@RaddyDev i too stucked at the same

    • @RaddyDev
      @RaddyDev  3 года назад

      Did you have a look at the article to see if your code is the same?

    • @RaddyDev
      @RaddyDev  3 года назад

      You are probably not getting the object

  • @RohitKumar-dz8dh
    @RohitKumar-dz8dh Год назад +1

    Heyy Raddy love your teaching. I am practicing along with you but I get error "could not find news " while render to news.ejs page . I couldn't resolve this error , would you tell me what can be issues for this error . I want to watch this complete video please help me .

    • @RaddyDev
      @RaddyDev  Год назад +1

      If you are not getting news it could be my firewall. Sometimes if you make too many requests my firewall might block them. Any errors?

    • @RohitKumar-dz8dh
      @RohitKumar-dz8dh Год назад +1

      @@RaddyDev Thanks sir resolved issues.

  • @realdevilman
    @realdevilman 4 года назад

    Awesome video!

    • @RaddyDev
      @RaddyDev  4 года назад

      Thank you 😉😎

  • @feefiifoofum
    @feefiifoofum 4 года назад +3

    Hey Raddy! New subscriber here, love the content! Quick question, if I am using the newsAPI, how do I set up the search parameters in the routes folder? I know it should be q=${search} but i am having trouble in actually implementing the form input to change the parameter for every request.

    • @RaddyDev
      @RaddyDev  4 года назад +4

      Thanks for the sub! It won't be much different from the WordPress example. The only difference would be that you need to swap the API URL (obviously haha) and go into the articles object.
      You would need to render:
      res.render('newsSearch', { articles : newsAPI.data.articles })
      And then update your newsSearch.ejs page to match the names. (example: urlToImage, title, description)
      I just added an example on the blog post ( Link is in the description ) - scroll to the bottom off the page and you will see it. It's getting a little messy, i need to tidy up the article one day.
      Thanks for the question and I hope that you stick around!

    • @feefiifoofum
      @feefiifoofum 4 года назад +1

      @@RaddyDev i got it to work! Thank you so much for the quick response. I will definetly keep up to date with your tutorials, you make these concepts easy to grasp. Keep up the good work 👏

    • @shubham_srt
      @shubham_srt 3 года назад

      @@feefiifoofum hey dude can you share the files with me I am unable to implement search while using news api

  • @taofiqcodes4303
    @taofiqcodes4303 3 года назад

    just watching this and love it mate...thank you so much..please can you do a tutorial on postman usage and full tutorial on API?

    • @RaddyDev
      @RaddyDev  3 года назад

      Sounds good to me! I've made a note and thank you for the comment!

    • @taofiqcodes4303
      @taofiqcodes4303 3 года назад

      @@RaddyDev can you share the note pls

    • @taofiqcodes4303
      @taofiqcodes4303 3 года назад

      @@RaddyDev okay now i understand thank you

  • @debasissaikia304
    @debasissaikia304 4 года назад

    Good content..need some more projects

    • @RaddyDev
      @RaddyDev  4 года назад

      Yeah I'll be adding a lot more. Thank you!

  • @RaminS-v5w
    @RaminS-v5w Год назад

    Awesome thank you

  • @habvielrgbimpc3447
    @habvielrgbimpc3447 4 года назад

    If I go to the website after 20:20 I get the error "Error: Failed to lookup view "news" in views directory "./src/views""
    Can you help me?

    • @RaddyDev
      @RaddyDev  4 года назад

      Did you add the Templating Engine code? 15:35. Other than that, it could be something silly like a typo.

  • @SonNguyen-po5tr
    @SonNguyen-po5tr 3 года назад +1

    Thanks for nice tuts ,btw can you give the name of the VS theme.

    • @RaddyDev
      @RaddyDev  3 года назад

      The theme is called Dracula. Thank you for watching

  • @nqha9x
    @nqha9x 3 года назад +1

    Could you create more videos like this using nodejs, express and about e-commerce websites?

    • @RaddyDev
      @RaddyDev  3 года назад +4

      Of course! I did create a new one recently showing you how to create a simple recipe website. It should be in my Node.js playlist if you want to check it out

  • @ahmedahmedx9600
    @ahmedahmedx9600 2 года назад

    Hi randy, can you please tell me which monitor you are using ? And is it good for programming and color accuracy ?

    • @RaddyDev
      @RaddyDev  2 года назад

      My monitors are fairly old and I am not even sure if you can still buy them. The model is Dell U2414H. They are perfect for programming, but I am not so sure about color accuracy. I can imagine that the new models would be much better.

  • @evanilsonp.9900
    @evanilsonp.9900 9 месяцев назад

    Hye raddy. The first part of the project we render 10 posts, but when we search for something in specific like node, some other results will appear and they are not in these 10 posts from home page. Depending on what you search for, it'll be more than 10 posts. How can I put more visible posts at home page?

    • @evanilsonp.9900
      @evanilsonp.9900 9 месяцев назад

      And another thing is when we search for something else that's not in the API, we just have a blanket page.

  • @newtanagmukhopadhyay4716
    @newtanagmukhopadhyay4716 2 года назад

    Bro just a small question.
    why did you do
    app.use(express.static('public'))
    and then
    app.use('/css',express.static(__dirname+'public/css'))
    i mean doing only the later would have sufficed right?
    also,in that file news.js file, res.render('news'). what exactly is 'news' here? like is it the name of the ejs file?

    • @RaddyDev
      @RaddyDev  2 года назад

      You only need app.use(express.static('public')) but the other examples where if you want to do a specific folder. I am not sure if I explained that well. Just use the first one and it will work. Regarding the news, yes that's the news.ejs file, but you don't have to specify the file extenuation name - ejs. I hope this helps!

  • @floydfernandes8844
    @floydfernandes8844 2 года назад

    hi @Raddy I seem to get this error around the 20th minute mark: throw new Error('No default engine was specified and no extension was provided.');
    ^
    Error: No default engine was specified and no extension was provided.
    This is when running the localhost on browser
    It seems to be something with express

    • @RaddyDev
      @RaddyDev  2 года назад

      it might be that you need to install ejs and then set the view engine to ejs.
      So install ejs:
      npm i ejs
      Set the view engine to ejs:
      app.set('view engine', 'ejs')
      Try that and let me know how it goes

    • @floydfernandes8844
      @floydfernandes8844 2 года назад +1

      @@RaddyDev one more question what if i want to use multiple api requests. Can i do it in the same get function or do i need a new one

    • @RaddyDev
      @RaddyDev  2 года назад

      @@floydfernandes8844 You can do multiple API requests inside one Get function it's not a problem

    • @floydfernandes8844
      @floydfernandes8844 2 года назад

      @@RaddyDev if possible can youblink me to an example i cant seem to find anything

    • @RaddyDev
      @RaddyDev  2 года назад

      @@floydfernandes8844 The only one I can think of is this one: ruclips.net/video/OEdPH4fV7vY/видео.html but instead of an API I used a database. It's fairly long and some of the packages have changed a little bit. You'll have to dig a little bit

  • @muhammedcansoy6131
    @muhammedcansoy6131 2 года назад

    excellent

  • @kunal7929
    @kunal7929 Год назад

    Thank you buddy

  • @medurisupriya1722
    @medurisupriya1722 4 года назад +1

    I get an error, article.foreach is not a function. can somebody help me with this?

    • @RaddyDev
      @RaddyDev  4 года назад

      Hi Meduri, did you managed to fix it? Check this stackoverflow. com /questions/31096596/why-is-foreach-not-a-function-for-this-object

    • @braiNN
      @braiNN 4 года назад

      its because his data is in an array, but if you're trying to access the news api all of their data is in an object.

    • @66_vaibhavvarunkar60
      @66_vaibhavvarunkar60 3 года назад

      I'm getting the same error

    • @66_vaibhavvarunkar60
      @66_vaibhavvarunkar60 3 года назад

      Did you solve it ? Help will be appreciated

    • @RaddyDev
      @RaddyDev  3 года назад

      @@66_vaibhavvarunkar60 the problem is what
      braiNN
      said above. Have a look at the link I posted and you should be able to solve it

  • @manoellopes
    @manoellopes 4 года назад

    Big thanks dude

    • @RaddyDev
      @RaddyDev  4 года назад +1

      Any time! Thank you for watching

  • @nabeelali5831
    @nabeelali5831 2 года назад

    can you link the json file, 22:44

    • @RaddyDev
      @RaddyDev  2 года назад

      raddy.dev/wp-json/v2/posts

  • @ferreiradelima96
    @ferreiradelima96 10 месяцев назад

    EJS Tags are not being interpreted.
    I already downloaded an extension for ejs on vscode but it didn't fix it.

    • @RaddyDev
      @RaddyDev  10 месяцев назад

      Did you install ejs and set it up correctly? Do you get any errors? The extension is there only to help you write ejs easier. Double-check your setup, I have a lot of simple examples here on youtube and also my blog if you are struggling

    • @ferreiradelima96
      @ferreiradelima96 10 месяцев назад

      @@RaddyDev I fixed it. thank you.
      I typed 'title.rendered' to be rendered.
      The correct form was 'article.title.rendered'

  • @alimodz6253
    @alimodz6253 4 года назад

    If I was getting a random color from Node.js server and I wanted to apply that color to my ejs template background, how do I add that color variable to the CSS file?

    • @RaddyDev
      @RaddyDev  4 года назад

      You could create a variable that holds your random color and then res.render it like so: res.render('index', { color: '#fff' }). In EJS you would have to just do to output the value. Then I guess you can add this pretty much anywhere you like. You could add it in a div with style="background color... or you could add it in body { background color ... You get the point. I hope this helps

    • @alimodz6253
      @alimodz6253 4 года назад

      @@RaddyDev thank you sir 👌

  • @kj1431
    @kj1431 Год назад

    Can we deploy this project on cyclic or any other deploying site, I am not able to deploy

    • @RaddyDev
      @RaddyDev  Год назад

      I actually did a tutorial on that and used the same project as an example. Check it out on my channel

  • @yishakabrham5002
    @yishakabrham5002 Год назад +1

    great

  • @sharveennagendran
    @sharveennagendran 4 года назад

    what must I do to add more than one route under the routes folder? Cause right now, I did the exact same for another route, however, the new route just overwrites the previous route.

    • @RaddyDev
      @RaddyDev  4 года назад +1

      I wounder why that is happening... I hope that I haven't made a mistake somewhere. I will look into it later and let you know. If you figure it out please let me know

    • @sharveennagendran
      @sharveennagendran 4 года назад +1

      @@RaddyDev roger that brother

    • @RaddyDev
      @RaddyDev  4 года назад +1

      I think that the problem comes from the position of the express middlware.
      You can do a quick fix by adding the new page at the top.
      app.use('/cart', cartRouter) - new
      app.use('/article', newsRouter)
      app.use('/', newsRouter)
      I quite like the approach explained here and it would be fairly easy to convert to:
      stackoverflow.com/questions/32418963/how-to-use-multiple-router-files
      I hope that this helps

    • @sharveennagendran
      @sharveennagendran 4 года назад

      @@RaddyDev Alright, thank you. Do I need to write const cartRouter = require('./src/routes/cart');
      app.use('/cart', cartRouter);?
      The reason I have two routers is that each router contains a different API from different sites, and I want to combine them both.

    • @RaddyDev
      @RaddyDev  4 года назад

      Yeah, you do need to add the const cartRouter. It's up to you how you want to structure your code. You could have controllers also to separate your functionality. That would make things better

  • @surajshivan7758
    @surajshivan7758 4 года назад

    Facing issue with the last step .It gives ENOENT error

    • @RaddyDev
      @RaddyDev  4 года назад

      Did you create the search.ejs file? It sounds like it's something to do with the path. Maybe you have a typo or something. You could reference the code on GitHub

    • @surajshivan7758
      @surajshivan7758 4 года назад

      @@RaddyDev created search.ejs file and still facing the same error bro

    • @RaddyDev
      @RaddyDev  4 года назад

      Could you share the code please? Maybe a GitHub link or a zip file will do

  • @SahilSharma-pk1gg
    @SahilSharma-pk1gg 4 года назад

    can you help me to fetch data from newsAPI . It's not working as that data is in object not in array.

    • @RaddyDev
      @RaddyDev  4 года назад

      Yes of course. I just updated the blog post with an example of how to get the data and display it. It's at the bottom of the article and the link is in the description. I hope this helps. I've added a little bit of explanation, but I will need to go back at some point and format it better haha

  • @tutscloud4818
    @tutscloud4818 4 года назад

    Hi. when i write this ->

    • @RaddyDev
      @RaddyDev  4 года назад +1

      It should be and or . It sounds like you have missed something. You could go on the Github page and reference the code. I hope this helps

    • @tutscloud4818
      @tutscloud4818 4 года назад

      @@RaddyDev i did miss on some spelling :D thanks for a reply though

    • @jessdeng9084
      @jessdeng9084 3 года назад

      ​@@tutscloud4818 I got the same error, how did you fix that problem? There is the red mark on what I have missed?

    • @waluwigii
      @waluwigii 3 года назад

      @@RaddyDev the < of my

  • @jacobsilverstein1727
    @jacobsilverstein1727 3 года назад

    If you have a private API key how do you protect it? Is the JS code visible in the source code?

    • @RaddyDev
      @RaddyDev  3 года назад

      In this example the JavaScript code is executed outside the web browser (back-end), so your API key won't be visible on the front-end. Thanks for the question 🙂

  • @ProdByTso
    @ProdByTso 3 года назад

    I have got to the end of creating our application I have all the code as you do but I cant open the localhost? when I search localhost:5000 theres no error but it doesnt load the page its forever searching?

    • @RaddyDev
      @RaddyDev  3 года назад

      How did you get to the end without starting the server?

    • @ProdByTso
      @ProdByTso 3 года назад

      @@RaddyDev I didnt it worked when you had the 'cannot get' message when i add all the other bits of code the server still says listening but doesnt load the page

    • @RaddyDev
      @RaddyDev  3 года назад

      That's strange. Have a look at the code on my blog or GitHub and see if you are missing something or have a typo. It could be something small, but without seeing the code I can't say. It's probably a typo somewhere that you have

    • @ProdByTso
      @ProdByTso 3 года назад

      @@RaddyDev thanks got the source code its working now :)

    • @RaddyDev
      @RaddyDev  3 года назад

      @@ProdByTso that's awesome. I am glad that it's working

  • @nikhilerigila1065
    @nikhilerigila1065 2 года назад +1

    app.use('/', newsRouter) throwing error throw new TypeError('Router.use() requires a middleware function but got a ' + gettype(fn))

    • @RaddyDev
      @RaddyDev  2 года назад +1

      In your news router page, you are probably missing " module.exports = newsRouter ". I hope this helps, Nikhil!

  • @codingmarina7309
    @codingmarina7309 2 года назад

    Hello, could vue.js be integrated into this project? Thank you

    • @RaddyDev
      @RaddyDev  2 года назад

      Yes, absolutely. Instead of using EJS to render pages, you can just use Node.Js as the middle software that grabs the data and then you can use Vue.js to fetch it and render it. It's a good little challenge

  • @passionatebeast24
    @passionatebeast24 3 года назад

    Thank you so much.

    • @RaddyDev
      @RaddyDev  3 года назад +1

      Thanks for the comment!

  • @krushnakantshaha5357
    @krushnakantshaha5357 2 года назад

    If we don't enter any text in search bar then how to handle that request?

    • @RaddyDev
      @RaddyDev  2 года назад

      There are a lot of options...
      Some ideas could be that you do a redirect to the homepage or maybe you display "No news found." with a nice layout and a big search bar. It's really up to you how you handle it. Whatever works for your application and whatever is best for conversion, ux and so on...
      if you were asking about the code, you can simply check to see if the input is empty and do the things I mentioned above

    • @krushnakantshaha5357
      @krushnakantshaha5357 2 года назад

      @@RaddyDev Okay i'll try this and thank you so much for quick response

  • @rajapaksha
    @rajapaksha 3 года назад

    im using "express": "^4.17.1". and body-parser not working

    • @RaddyDev
      @RaddyDev  3 года назад

      The body-parser is now part of Express. They recently changed it. Use this instead: app.use(express.urlencoded({extended: true})); I've updated the blog post

    • @rajapaksha
      @rajapaksha 3 года назад

      @@RaddyDev thnkyou

  • @venkatesh2788
    @venkatesh2788 4 года назад +1

    Please make more node projects

    • @RaddyDev
      @RaddyDev  4 года назад +1

      I do have a few ideas on my list, but I would like to hear if you have anything in mind also? Thanks for the comment!

    • @venkatesh2788
      @venkatesh2788 4 года назад +1

      @@RaddyDev you can try how to connect Node js and React js, and make any simple project

    • @RaddyDev
      @RaddyDev  4 года назад

      Unfortunately I am not familiar with ReactJS, but it's something that I could explore. I mainly use Angular for my project. Thank you for the suggestion

  • @yogesdhakal
    @yogesdhakal 3 года назад

    can you also teach us how to add pagination to the news page .. it would really mean a lot .. thank you ..

    • @RaddyDev
      @RaddyDev  3 года назад +1

      Next time I try to do something similar (which might be very soon) I will try to incorporate one. Thanks for the suggestion Yogesh!

    • @yogesdhakal
      @yogesdhakal 3 года назад

      @@RaddyDev thank you.. Looking forward to it.. I completed this one and was wondering how to add pagination.. Ejs is tricky

  • @xmxmxmxmxxmxmxmmx4981
    @xmxmxmxmxxmxmxmmx4981 3 года назад

    Thank you.

    • @RaddyDev
      @RaddyDev  3 года назад

      Thank you for watching!

  • @kamanakarki2483
    @kamanakarki2483 Год назад

    Do we use any Algorithm here??

    • @RaddyDev
      @RaddyDev  Год назад

      Yep. Nothing too complex :)

  • @cxnftunreal
    @cxnftunreal 3 года назад

    How were you able to run the webpage on your browser. Having issues with that

    • @RaddyDev
      @RaddyDev  3 года назад +1

      You have to create a Node.js server and then start the server. That's the first 20 min of the video. What issues are you having?

    • @cxnftunreal
      @cxnftunreal 3 года назад

      @@RaddyDev I created the server using npm on my Powershell, but when I run localhost:5000 it tells me site can't be reached

    • @RaddyDev
      @RaddyDev  3 года назад

      @@cxnftunreal Do you get an error in your console when you do npm start?

    • @cxnftunreal
      @cxnftunreal 3 года назад

      @@RaddyDev it just stops on listening on port 5000 after nothing

    • @RaddyDev
      @RaddyDev  3 года назад

      @@cxnftunreal That's strange. Try a different port number. Something like 3000 or 8080...

  • @greglouis5779
    @greglouis5779 3 года назад

    Sir how if someone want to add its own block for news on the website

    • @RaddyDev
      @RaddyDev  3 года назад

      I guess you could do the same thing as long as you can get the news from an API, XML or anything like that

    • @greglouis5779
      @greglouis5779 3 года назад

      @@RaddyDev can i talk with you in private please? What platform can we discuss

    • @greglouis5779
      @greglouis5779 3 года назад

      @@RaddyDev i am actually trying to get an API from twitter as you shared in the link

    • @RaddyDev
      @RaddyDev  3 года назад

      The process of making it work should be the same as WordPress - just different different naming conventions in the response object that you get

  • @rakeshjain2152
    @rakeshjain2152 2 года назад

    Hey! I thought your hosting plan was expired

    • @RaddyDev
      @RaddyDev  2 года назад

      The raddy dot dev one? What happened?

  • @mithunvishnu5089
    @mithunvishnu5089 2 года назад

    how can i ge this project ? please raddy send me any link

    • @RaddyDev
      @RaddyDev  2 года назад

      Hi, here is the link. raddy dot dev/blog/build-news-website-with-node-js-express-ejs-wp-rest-api/

  • @adad8795
    @adad8795 4 года назад

    Awesome

    • @RaddyDev
      @RaddyDev  4 года назад

      I am glad that you liked it! 👌

  • @yaseenimuhammadraja9461
    @yaseenimuhammadraja9461 3 года назад

    Hai sir, Great tutorial 👍.
    And I have one doubt that is,
    How to render multiple result from MySQL query on the same .ejs file on Node.js and Express?

    • @RaddyDev
      @RaddyDev  3 года назад +1

      If you are talking about multiple records, you can just loop through the object with EJS and display the results. You can use a for each loop to do that. And if you are talking about having two different objects coming back from MySQL, you can still loop thru them, but you'll have to do that twice. You could create a new object that combines the results and then loop. I think that I said loop too many times haha. I hope this helps

  • @jcdsr1
    @jcdsr1 3 года назад

    It will be nice a tutorial on how to build a URL instead of using id, using the URL field or converting the title of the post into a URL

    • @jcdsr1
      @jcdsr1 3 года назад

      Also thanks for your tutorial

    • @RaddyDev
      @RaddyDev  3 года назад

      It would have been better if I did that on this tutorial. I could do a new one with handlebars, but I need to find a good API to get some data. I don't want to use the NewsApi or WP. I will try to think of something. Thanks for the suggestion

  • @conormooore5192
    @conormooore5192 Год назад

    Hi could you make a Spotify website like this?

    • @RaddyDev
      @RaddyDev  Год назад

      Using their API? I could do that. We'll need some front end JS for interactivity, but that can be done

  • @sairajkulkarni1347
    @sairajkulkarni1347 Год назад

    make a vdo on its deployment

    • @RaddyDev
      @RaddyDev  Год назад

      Here: ruclips.net/video/q8GSWGu2roA/видео.html

  • @mohsinirfan4498
    @mohsinirfan4498 3 года назад

    how can we make our rest api link

    • @RaddyDev
      @RaddyDev  3 года назад

      I guess you mean to publish it with a domain name? You could use a platform like Heroku to do that. I have a video tutorial on that and there is a free tier

    • @mohsinirfan4498
      @mohsinirfan4498 3 года назад

      @@RaddyDev Sir i mean that i create a rest api how to print my rest api data into html file

    • @RaddyDev
      @RaddyDev  3 года назад

      @@mohsinirfan4498 you can use EJS just like I have on this video

  • @jianhe
    @jianhe 3 года назад

    ejs if format is really very hard.

    • @RaddyDev
      @RaddyDev  3 года назад

      Yeah I find it hard to type, but it's fairly powerful

  • @sanjaykandula4240
    @sanjaykandula4240 Год назад

    updated api link we need

    • @RaddyDev
      @RaddyDev  Год назад +1

      Working on it... I don't know when and what has changed in order the API not to work.

    • @RaddyDev
      @RaddyDev  Год назад

      Fixed, it looks like the API has changed slightly: /wp-json/wp/v2/posts

  • @OhReallyHuman
    @OhReallyHuman 3 года назад

    vizwishtudio code hehe... great tutorial though!

  • @fernandosoaresdev
    @fernandosoaresdev 2 года назад

    Hi, great video you dropped on us! Thanks for the shared knowledge! Can you tell me what color scheme/color theme are you using? +1 Sub with the bell!

    • @RaddyDev
      @RaddyDev  2 года назад +1

      Thanks, Fernando! It should be Dracula the free version

  • @braiNN
    @braiNN 4 года назад

    use. semicolons. please. thank. you.