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

Поділитися
Вставка
  • Опубліковано 13 гру 2024

КОМЕНТАРІ • 90

  • @andresfelipeyanquen7194
    @andresfelipeyanquen7194 3 роки тому +5

    The best programmer that I've watched at UA-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.

  • @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

  • @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

  • @serenacula3256
    @serenacula3256 2 роки тому +3

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

  • @SzrIsTaken786
    @SzrIsTaken786 2 роки тому +1

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

  • @BizzaroBrainBoi
    @BizzaroBrainBoi Рік тому +1

    This video is the real deal. Thank you.

  • @MOWO6
    @MOWO6 8 місяців тому +1

    Detailed explanation... wonderful thankyou....

  • @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💫💫💫

  • @amirhussain9949
    @amirhussain9949 2 роки тому

    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.

  • @gleon1602
    @gleon1602 Рік тому +2

    This makes perfect sense. Thanks for clearing up my doubts

  • @ppsdeveloper9448
    @ppsdeveloper9448 3 роки тому +3

    Thank you teacher.

  • @sasqo
    @sasqo 2 роки тому +1

    very good tutorial for me as a beginner. Thanks

  • @20harshu61
    @20harshu61 2 місяці тому +1

    pro for a reason 🔥🔥🔥🔥🔥🔥

  • @lekshmiraj3496
    @lekshmiraj3496 Рік тому +2

    thankyou very much sir😍😍

  • @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?

  • @Aliena92
    @Aliena92 8 місяців тому +1

    Thank you! Very helpful :)

  • @TaylanG
    @TaylanG 3 роки тому +1

    Thank you for this tutorial, it really helped me.

  • @adrian6725
    @adrian6725 2 роки тому +1

    Great tutorial!

  • @meluus
    @meluus Рік тому +1

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

  • @outornotout7336
    @outornotout7336 Рік тому

    Thanks bro... it was v.helpful

  • @hank_bloodshadow
    @hank_bloodshadow Місяць тому +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  Місяць тому

      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 Місяць тому

      @@KindsonTheTechPro ah thanks for the insight

    • @hank_bloodshadow
      @hank_bloodshadow Місяць тому

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

  • @Balaaaa10
    @Balaaaa10 11 місяців тому +1

    Thank you man💚

  • @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 Рік тому

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

  • @manojkrishna1157
    @manojkrishna1157 Рік тому +1

    Thank you

  • @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

  • @no0x985
    @no0x985 2 роки тому

    I love you bro, thanks a lot :)

  • @Liya7730
    @Liya7730 3 роки тому

    simply awesome

  • @JustEnjoyL1fe
    @JustEnjoyL1fe 4 місяці тому

    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.

  • @Gester2000
    @Gester2000 2 роки тому

    As said u r great❤️

  • @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?

  • @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?

  • @GIS-Engineer
    @GIS-Engineer 2 роки тому

    Populating Drop Down menus from POSTGRESQL Database and nodejs

  • @senamahadzi5716
    @senamahadzi5716 3 роки тому

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

  • @hassantariq6645
    @hassantariq6645 2 роки тому

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

  • @shuvoroy8645
    @shuvoroy8645 Рік тому

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

  • @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?

  • @OmarMohamed-ge2zg
    @OmarMohamed-ge2zg 2 роки тому

    thank u

  • @mohammadarshad1698
    @mohammadarshad1698 3 роки тому

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

  • @markconstantino6331
    @markconstantino6331 3 роки тому +1

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

  • @jorkaefdev
    @jorkaefdev 2 роки тому +1

    hey how could i get a value by name?

    • @KindsonTheTechPro
      @KindsonTheTechPro  2 роки тому

      This question will be covered in this series ua-cam.com/video/65Yw53NDGio/v-deo.html

  • @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

  • @MakarovSergey39
    @MakarovSergey39 10 місяців тому +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.

  • @jeromeashibuogwu4971
    @jeromeashibuogwu4971 Рік тому

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

  • @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.

  • @mayankparmar5214
    @mayankparmar5214 3 роки тому

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

  • @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

  • @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

  • @ThongMr
    @ThongMr 2 роки тому

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

  • @gilberttuason6051
    @gilberttuason6051 3 роки тому

    body-parser depracated .json

  • @arupde6320
    @arupde6320 Рік тому

    be regular

  • @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.