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

  Рет қаралды 54,092

Kindson The Tech Pro

Kindson The Tech Pro

3 жыл бұрын

This video is a complete tutorial on how to build a Simple REST API with Node.js and PostgreSQL. A step by step tutorial for beginners. We'll test the REST API by using Postman Client to make GET, POST, PUT and DELETE request
Complete procedure and source codes here - www.kindsonthegenius.com/buil...
The folowing are covered in this tutorial:
👉Setup PostgreSQL/Nodejs
👉Create Database Connection
👉Create the Server and Client
👉Get All Users
👉Get a User By Id
👉Insert New User
👉Update a User
👉Delete a User
My websites
www.kindsonthegenius.com
www.munonye.com
www.datarmatics.com
Learn Programming by joining International Computer Programmers here:
👉 / 1447709731988533
Feel free to connect with me
❤️ Facebook: / kindsonm
❤️ Instagram: / kindsonthegius
❤️ LinkedIn: / kindson
❤️ Twitter: / kindsonm
Your support can help me improve my content:
✅ Buy me a coffee: www.buymeacoffee.com/PWsXo7h13
✅ Support me on Patreon: / kindsonthegenius

Пікірлер: 79
@serenacula3256
@serenacula3256 Жыл бұрын
This tutorial is super useful, best one I've found on the postgres package. Thanks for making it!
@KindsonTheTechPro
@KindsonTheTechPro Жыл бұрын
Glad it was helpful!
@mushfiqfuad249
@mushfiqfuad249 3 жыл бұрын
Kindson, you are my most favorite instructor. You make me love spring boot. Want more Spring boot videos.
@KindsonTheTechPro
@KindsonTheTechPro 3 жыл бұрын
Thanks a lot for this motivation!
@andresfelipeyanquen7194
@andresfelipeyanquen7194 3 жыл бұрын
The best programmer that I've watched at KZfaq. Greeting from Colombia Sr! and Thanks for this video!!
@KindsonTheTechPro
@KindsonTheTechPro 2 жыл бұрын
You're very welcome!😊
@eternal_glide
@eternal_glide 2 жыл бұрын
I'm just starting to see, but this is what I've been looking for very much. Thank you kindson
@KindsonTheTechPro
@KindsonTheTechPro 2 жыл бұрын
You're very welcome!
@ryanenoch4279
@ryanenoch4279 Жыл бұрын
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?
@BizzaroBrainBoi
@BizzaroBrainBoi 10 ай бұрын
This video is the real deal. Thank you.
@SzrIsTaken786
@SzrIsTaken786 2 жыл бұрын
Absolutely clutch loved the video my guy!!!!!
@KindsonTheTechPro
@KindsonTheTechPro 2 жыл бұрын
Appreciate it!!
@jeesamyu436
@jeesamyu436 Жыл бұрын
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💫💫💫
@sasqo
@sasqo 2 жыл бұрын
very good tutorial for me as a beginner. Thanks
@MOWO6
@MOWO6 3 ай бұрын
Detailed explanation... wonderful thankyou....
@ClashingMujju
@ClashingMujju 9 ай бұрын
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
@amirhussain9949
@amirhussain9949 Жыл бұрын
Thank you sir...Your teaching expression is superb sir
@gleon1602
@gleon1602 Жыл бұрын
This makes perfect sense. Thanks for clearing up my doubts
@nanashialfarr
@nanashialfarr 2 жыл бұрын
Thank you for this wonderful tutorial, I was struggling to make an api for my app for university here.
@KindsonTheTechPro
@KindsonTheTechPro 2 жыл бұрын
You're very welcome!😊
@TaylanG
@TaylanG 2 жыл бұрын
Thank you for this tutorial, it really helped me.
@KindsonTheTechPro
@KindsonTheTechPro 2 жыл бұрын
Glad to hear that!
@Aliena92
@Aliena92 3 ай бұрын
Thank you! Very helpful :)
@outornotout7336
@outornotout7336 Жыл бұрын
Thanks bro... it was v.helpful
@melus86
@melus86 Жыл бұрын
Thanks for your valuable work. did you make a video with calling this api on an angular app? Thank you
@Balaaaa10
@Balaaaa10 5 ай бұрын
Thank you man💚
@lekshmiraj3496
@lekshmiraj3496 8 ай бұрын
thankyou very much sir😍😍
@no0x985
@no0x985 Жыл бұрын
I love you bro, thanks a lot :)
@Liya7730
@Liya7730 3 жыл бұрын
simply awesome
@adrian6725
@adrian6725 2 жыл бұрын
Great tutorial!
@KindsonTheTechPro
@KindsonTheTechPro 2 жыл бұрын
Thank you so so much!
@senamahadzi5716
@senamahadzi5716 3 жыл бұрын
Hi kindson, im having some issues with my post? it is saying Cannot read property 'query' of undefined. Any help?
@ppsdeveloper9448
@ppsdeveloper9448 3 жыл бұрын
Thank you teacher.
@KindsonTheTechPro
@KindsonTheTechPro 3 жыл бұрын
You are welcome
@manojkrishna1157
@manojkrishna1157 7 ай бұрын
Thank you
@Gester2000
@Gester2000 Жыл бұрын
As said u r great❤️
@mohammadarshad1698
@mohammadarshad1698 2 жыл бұрын
How do you check user already exit or not. By return through Json
@sanjeev8720
@sanjeev8720 11 ай бұрын
Hi sir can you please explain how to read Excel data and compare that data with postgre SQL database data by using node js
@sanjaibalajinallasivam3291
@sanjaibalajinallasivam3291 Жыл бұрын
how can we show 2 or more database tables in a single API? Can you please suggest me any references?
@junweiliang8280
@junweiliang8280 2 жыл бұрын
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 Жыл бұрын
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
@hassantariq6645
@hassantariq6645 2 жыл бұрын
Can you makes tutorial on how to insert image in postgresql and creat api get request please
@Traveler250
@Traveler250 Жыл бұрын
Hello sir, im sending request in postman and i get inn vs code that relation users doesnt exist. help
@OmarMohamed-ge2zg
@OmarMohamed-ge2zg Жыл бұрын
thank u
@markconstantino6331
@markconstantino6331 3 жыл бұрын
Why i cant connect to local host, it says module not found
@othmaaneWR
@othmaaneWR 2 жыл бұрын
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 Жыл бұрын
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 6 ай бұрын
He is talking about body format in postman, you will see text in top-down menu change it to JSON
@mayankparmar5214
@mayankparmar5214 3 жыл бұрын
I am getting this error - UnhandledPromiseRejectionWarning: Error: connect ECONNREFUSED 127.0.0.1:5432
@mohammadarshad1698
@mohammadarshad1698 2 жыл бұрын
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
@jeromeashibuogwu4971
@jeromeashibuogwu4971 7 ай бұрын
im stuck on an infinite load what can i do to solve that
@shuvoroy8645
@shuvoroy8645 Жыл бұрын
Bro please create a video CRUD app using react node express and postgre
@GIS-Engineer
@GIS-Engineer 2 жыл бұрын
Populating Drop Down menus from POSTGRESQL Database and nodejs
@evonchong91
@evonchong91 2 жыл бұрын
Hi, I am getting cannot GET /. May i know how to go about resolving it?
@tshifhiwaramasala390
@tshifhiwaramasala390 5 ай бұрын
did you find solution ?
@MakarovSergey39
@MakarovSergey39 5 ай бұрын
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.
@jorkaefdev
@jorkaefdev 2 жыл бұрын
hey how could i get a value by name?
@KindsonTheTechPro
@KindsonTheTechPro 2 жыл бұрын
This question will be covered in this series kzfaq.info/get/bejne/bJuJqphks6qrmaM.html
@ThongMr
@ThongMr Жыл бұрын
Pls, I cant post and put data. Error Cannot PUT /users/
@infiniteobservations8137
@infiniteobservations8137 3 жыл бұрын
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 2 жыл бұрын
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
@fatsamuel2000
@fatsamuel2000 2 жыл бұрын
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 2 жыл бұрын
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 2 жыл бұрын
Thank you Kingson, I had a double connection with another code
@azhar5895
@azhar5895 Жыл бұрын
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.
@gilberttuason6051
@gilberttuason6051 2 жыл бұрын
body-parser depracated .json
@arupde6320
@arupde6320 Жыл бұрын
be regular
@rfryanfavour4369
@rfryanfavour4369 Жыл бұрын
No 😂not angular... React or Next thank you....❤
@CT_9
@CT_9 2 жыл бұрын
dislike button
@KindsonTheTechPro
@KindsonTheTechPro 2 жыл бұрын
Y?
@MarkKeckeis
@MarkKeckeis Жыл бұрын
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.
How to build a REST API with Node js & Express
58:40
Programming with Mosh
Рет қаралды 1,7 МЛН
Build restful API with PostgreSQL and Express
39:26
Quacklearner
Рет қаралды 98 М.
I CAN’T BELIEVE I LOST 😱
00:46
Topper Guild
Рет қаралды 89 МЛН
My little bro is funny😁  @artur-boy
00:18
Andrey Grechka
Рет қаралды 13 МЛН
Implementing User Authentication With Node JS and PostgreSQL
1:29:33
Conor Bailey
Рет қаралды 115 М.
Node JS & PostgreSQL полный курс 2021 Rest API
20:08
Build your first REST API with Flask and PostgreSQL
27:42
teclado
Рет қаралды 60 М.
Build a Rest Api with NodeJS (JavaScript), Express, and PostgreSQL
1:07:53
tRPC, gRPC, GraphQL or REST: when to use what?
10:46
Software Developer Diaries
Рет қаралды 71 М.
Connect Node to Postgres
8:34
WittCode
Рет қаралды 13 М.
I CAN’T BELIEVE I LOST 😱
00:46
Topper Guild
Рет қаралды 89 МЛН