How to Build a REST API with Node.js and PostgreSQL - Complete Step by Step Tutorial for Beginners

แชร์
ฝัง
  • เผยแพร่เมื่อ 21 พ.ย. 2024

ความคิดเห็น • 90

  • @ClashingMujju
    @ClashingMujju ปีที่แล้ว +1

    just by watching your this video I have learnt a lot....thanks a lot....!!!!!
    please make some videos on react login/signup pages and fecting the data from db

  • @andresfelipeyanquen7194
    @andresfelipeyanquen7194 3 ปีที่แล้ว +5

    The best programmer that I've watched at TH-cam. Greeting from Colombia Sr! and Thanks for this video!!

  • @mushfiqfuad249
    @mushfiqfuad249 3 ปีที่แล้ว +3

    Kindson, you are my most favorite instructor. You make me love spring boot. Want more Spring boot videos.

  • @jeesamyu436
    @jeesamyu436 2 ปีที่แล้ว +1

    This is my first day working on node and postgres , my team lead gave me task crud operation with image uploadable frontend using reactjs, it's too though!!
    Thanks bro💫💫💫

  • @eternal_glide
    @eternal_glide 2 ปีที่แล้ว +3

    I'm just starting to see, but this is what I've been looking for very much. Thank you kindson

  • @lekshmiraj3496
    @lekshmiraj3496 ปีที่แล้ว +2

    thankyou very much sir😍😍

  • @amirhussain9949
    @amirhussain9949 ปีที่แล้ว

    Thank you sir...Your teaching expression is superb sir

  • @nanashialfarr
    @nanashialfarr 3 ปีที่แล้ว +2

    Thank you for this wonderful tutorial, I was struggling to make an api for my app for university here.

  • @serenacula3256
    @serenacula3256 2 ปีที่แล้ว +3

    This tutorial is super useful, best one I've found on the postgres package. Thanks for making it!

  • @MOWO6
    @MOWO6 7 หลายเดือนก่อน +1

    Detailed explanation... wonderful thankyou....

  • @meluus
    @meluus ปีที่แล้ว +1

    Thanks for your valuable work.
    did you make a video with calling this api on an angular app?
    Thank you

  • @ryanenoch4279
    @ryanenoch4279 2 ปีที่แล้ว

    I have been looking for a REST API, SQL, Node JS tutorial on Mac. Your tutorial saved me some time and trouble. Thanks Kindson
    Could u do some more SQL, Node js, Rest API tutorials for different scenarios like E-commerce websites?

  • @sasqo
    @sasqo 2 ปีที่แล้ว +1

    very good tutorial for me as a beginner. Thanks

  • @20harshu61
    @20harshu61 2 หลายเดือนก่อน +1

    pro for a reason 🔥🔥🔥🔥🔥🔥

  • @BizzaroBrainBoi
    @BizzaroBrainBoi ปีที่แล้ว +1

    This video is the real deal. Thank you.

  • @SzrIsTaken786
    @SzrIsTaken786 2 ปีที่แล้ว +1

    Absolutely clutch loved the video my guy!!!!!

  • @JustEnjoyL1fe
    @JustEnjoyL1fe 3 หลายเดือนก่อน

    Great job! But in your video you mentioned some errors and that you would update/change them, but when i go to your website its still not updated.

  • @ppsdeveloper9448
    @ppsdeveloper9448 3 ปีที่แล้ว +3

    Thank you teacher.

  • @outornotout7336
    @outornotout7336 ปีที่แล้ว

    Thanks bro... it was v.helpful

  • @gleon1602
    @gleon1602 ปีที่แล้ว +2

    This makes perfect sense. Thanks for clearing up my doubts

  • @hassantariq6645
    @hassantariq6645 2 ปีที่แล้ว

    Can you makes tutorial on how to insert image in postgresql and creat api get request please

  • @sanjeev8720
    @sanjeev8720 ปีที่แล้ว +1

    Hi sir can you please explain how to read Excel data and compare that data with postgre SQL database data by using node js

  • @TaylanG
    @TaylanG 3 ปีที่แล้ว +1

    Thank you for this tutorial, it really helped me.

  • @Aliena92
    @Aliena92 8 หลายเดือนก่อน +1

    Thank you! Very helpful :)

  • @hank_bloodshadow
    @hank_bloodshadow 24 วันที่ผ่านมา +1

    shouldn't we be using `SELECT * FROM users WHERE id=?` instead of putting the request values straight into the sql? or does that not work the same in postgres?

    • @KindsonTheTechPro
      @KindsonTheTechPro  23 วันที่ผ่านมา

      Actually SQL-level PREPARE in PostgreSQL does not support the ? placeholder, it uses the $1 ... $n style which is also a better option that having the parameter values in the query

    • @hank_bloodshadow
      @hank_bloodshadow 23 วันที่ผ่านมา

      @@KindsonTheTechPro ah thanks for the insight

    • @hank_bloodshadow
      @hank_bloodshadow 23 วันที่ผ่านมา

      @@KindsonTheTechPro glad I asked as I would have encountered that issue with the system I’m making 😂

  • @adrian6725
    @adrian6725 2 ปีที่แล้ว +1

    Great tutorial!

  • @othmaaneWR
    @othmaaneWR 2 ปีที่แล้ว +3

    note: make sure you set the body format in json and not text so it can read the data you input, else it will either give you an error or input it as the default value

    • @franciscafernandezaburto4704
      @franciscafernandezaburto4704 2 ปีที่แล้ว

      Hi! I'm having this error and I don't know how to fix it, I did evrything just like in this video, have an idea on what could be wrong?

    • @LordR123
      @LordR123 ปีที่แล้ว

      @@franciscafernandezaburto4704 did you figured it out? mine was the [] that i copied together......... also makes sure that the json and url /users/ with the / in the end

    • @at-r3x225
      @at-r3x225 11 หลายเดือนก่อน

      He is talking about body format in postman, you will see text in top-down menu change it to JSON

  • @Balaaaa10
    @Balaaaa10 10 หลายเดือนก่อน +1

    Thank you man💚

  • @shuvoroy8645
    @shuvoroy8645 ปีที่แล้ว

    Bro please create a video CRUD app using react node express and postgre

  • @manojkrishna1157
    @manojkrishna1157 11 หลายเดือนก่อน +1

    Thank you

  • @manasahr478
    @manasahr478 ปีที่แล้ว

    How to create api for sql server stored procedure using nodejs.. Could please help me

  • @sanjaibalajinallasivam3291
    @sanjaibalajinallasivam3291 2 ปีที่แล้ว +1

    how can we show 2 or more database tables in a single API? Can you please suggest me any references?

  • @no0x985
    @no0x985 2 ปีที่แล้ว

    I love you bro, thanks a lot :)

  • @MakarovSergey39
    @MakarovSergey39 9 หลายเดือนก่อน +1

    How do I host a PostgreSQL database and deploy Node.js+express+sequelize server for free ? I've been tired using aws ec2+supabase that only free for a week, render no longer free, railway no longer free, and heroku also no longer free. Please make the tutorial bro, especially with vercel(for db hosting and server deployment), much apprreciated Thankss.

  • @Gester2000
    @Gester2000 2 ปีที่แล้ว

    As said u r great❤️

  • @OmarMohamed-ge2zg
    @OmarMohamed-ge2zg 2 ปีที่แล้ว

    thank u

  • @Liya7730
    @Liya7730 3 ปีที่แล้ว

    simply awesome

  • @GIS-Engineer
    @GIS-Engineer 2 ปีที่แล้ว

    Populating Drop Down menus from POSTGRESQL Database and nodejs

  • @mohammadarshad1698
    @mohammadarshad1698 3 ปีที่แล้ว

    How do you check user already exit or not. By return through Json

  • @Traveler250
    @Traveler250 ปีที่แล้ว

    Hello sir,
    im sending request in postman and i get inn vs code that relation users doesnt exist. help

  • @evonchong91
    @evonchong91 2 ปีที่แล้ว +1

    Hi, I am getting cannot GET /. May i know how to go about resolving it?

  • @markconstantino6331
    @markconstantino6331 3 ปีที่แล้ว +1

    Why i cant connect to local host, it says module not found

  • @jeromeashibuogwu4971
    @jeromeashibuogwu4971 ปีที่แล้ว

    im stuck on an infinite load what can i do to solve that

  • @junweiliang8280
    @junweiliang8280 2 ปีที่แล้ว +1

    Thank you for your tutorial, I got a problem when I try to run app.get() function. it runs "client.end();" before "client.query" which leads the termination of database connection before I get the data rows. I guess the reason is because it is a async function and there is a mitigation on "client.query()". I just delete "client.end();" and it successfully runs. But the database will remain connected. Do we need end() it for each functions here? It looks stupid that users connect/disconnect database for each operation.

    • @serenacula3256
      @serenacula3256 2 ปีที่แล้ว

      I also had trouble with this, and double-checked. What he actually writes is client.end, like a variable, not client.end() as I instinctively wrote. Once I changed that it worked.
      I don't know why it's set up like that. Maybe it's a getter function for some reason?

  • @jorkaefdev
    @jorkaefdev 2 ปีที่แล้ว +1

    hey how could i get a value by name?

    • @KindsonTheTechPro
      @KindsonTheTechPro  2 ปีที่แล้ว

      This question will be covered in this series th-cam.com/video/65Yw53NDGio/w-d-xo.html

  • @senamahadzi5716
    @senamahadzi5716 3 ปีที่แล้ว

    Hi kindson, im having some issues with my post? it is saying Cannot read property 'query' of undefined. Any help?

  • @fatsamuel2000
    @fatsamuel2000 3 ปีที่แล้ว +1

    I have this warning: (node:29416) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with
    .catch().

    • @KindsonTheTechPro
      @KindsonTheTechPro  3 ปีที่แล้ว

      Which operation gives this error? There may be a typo in your code. Check your code against the code in the step by step here www.kindsonthegenius.com/build-a-rest-api-with-node-js-and-postgresql-get-post-putdelete-step-by-step/
      Let me know if you succceed to fix it.

    • @fatsamuel2000
      @fatsamuel2000 3 ปีที่แล้ว

      Thank you Kingson, I had a double connection with another code

  • @azhar5895
    @azhar5895 2 ปีที่แล้ว +1

    when i type node api.js, i get a TypeError: client.connect is not a function

    • @plakataTV
      @plakataTV ปีที่แล้ว

      Hello, did you ever figure this out? I got the same error message.

  • @ThongMr
    @ThongMr 2 ปีที่แล้ว

    Pls, I cant post and put data.
    Error
    Cannot PUT /users/

  • @infiniteobservations8137
    @infiniteobservations8137 3 ปีที่แล้ว +1

    I am using app.post and I get the following: TypeError: Cannot read property 'id' of undefined ???!!

    • @andresfelipeyanquen7194
      @andresfelipeyanquen7194 3 ปีที่แล้ว

      I have the same error. Could you solve that?

    • @marcoviallefont1046
      @marcoviallefont1046 3 ปีที่แล้ว

      I had the same problem. Your data must be written in JSON format in the "pre-request script" section of postman.

    • @umangsahu7393
      @umangsahu7393 2 ปีที่แล้ว

      I have the same problem did any one get the solution

    • @umangsahu7393
      @umangsahu7393 2 ปีที่แล้ว

      @@marcoviallefont1046 could you please solve my problem

  • @mohammadarshad1698
    @mohammadarshad1698 3 ปีที่แล้ว

    app.get('/users/:id', (req, res)=>{ client.query(`Select * from users where id=${req.params.id}`, (err, result)=>{ if(!err){ res.send(result.rows); } }); client.end; })
    How can we check if user is not exit.then how to show message not exit through Json. Please help me this question

  • @mayankparmar5214
    @mayankparmar5214 3 ปีที่แล้ว

    I am getting this error - UnhandledPromiseRejectionWarning: Error: connect ECONNREFUSED 127.0.0.1:5432

  • @arupde6320
    @arupde6320 ปีที่แล้ว

    be regular

  • @gilberttuason6051
    @gilberttuason6051 3 ปีที่แล้ว

    body-parser depracated .json

  • @rfryanfavour4369
    @rfryanfavour4369 ปีที่แล้ว

    No 😂not angular... React or Next thank you....❤

  • @CT_9
    @CT_9 3 ปีที่แล้ว

    dislike button

  • @MarkKeckeis
    @MarkKeckeis ปีที่แล้ว +1

    kindson - thanks so much for making these videos.
    I am just learning postgres and have a node script that tries to emulate the one you had in the video prior to this one. When I run the script - it looks like it cant find the table that I have described in your prior video. Here is my code:
    const {Client} = require('pg');
    const client = new Client({
    host: "localhost",
    user: "postgres",
    port: 5432,
    password: "***********",
    database: "glennis"
    });
    client.connect();
    console.log('Connected');
    client.query(`Select * from Case`,(err,res)=>{
    if(!err){
    console.log(res.rows[1]);
    } else{
    console.log('This is an error ==> ' + err.message);
    }
    client.end;
    })
    the script is able to connect to the db but fails on the query. The 'case' table is in the db - I can see it from TablesPlus.
    Any tips? And many thanks for any help.