Planning & First Steps | Creating a REST API with Node.js

  Переглядів 416,271

Academind

Academind

6 років тому

Time to dive into it! Let's start building our Node RESTful API. Well actually, let's quickly plan it before we start.
🖥️ Official Website & Courses
academind.com/courses/
👨‍💻 Full Node.js Course
acad.link/nodejs
👋 Social Media
/ maxedapps
/ academind_real
/ academind_real
/ academindchannel
💬 Academind Community on Discord
/ discord
----------
Academind is your source for online education in the areas of web development, frontend web development, backend web development, programming, coding and data science! No matter if you are looking for a tutorial, a course, a crash course, an introduction, an online tutorial or any related video, we try our best to offer you the content you are looking for. Our topics include Angular, React, Vue, Html, CSS, JavaScript, TypeScript, Redux, Nuxt.js, RxJs, Bootstrap, Laravel, Node.js, Progressive Web Apps (PWA), Ionic, React Native, Regular Expressions (RegEx), Stencil, Power BI, Amazon Web Services (AWS), Firebase or other topics, make sure to have a look at this channel or at academind.com to find the learning resource of your choice!

КОМЕНТАРІ: 260
@Kjata316
@Kjata316 4 роки тому
THANK YOU for this! Very helpful!
@michaelliriano5027
@michaelliriano5027 3 роки тому
Best nodejs walkthrough on UKposts
@AbhishekKumar-mq1tt
@AbhishekKumar-mq1tt 6 років тому
Thank you for this awesome series and also make social network website like Facebook with nodejs, express, mongodb. I every day waiting for your video's
@justTas_
@justTas_ 3 роки тому
Max has been teaching me to be a better developer for three years now! Let's goooo! 😊😊😊😊😊
@sadmanchowdhury4165
@sadmanchowdhury4165 3 роки тому
thank you Academind for this part
@simonty1811
@simonty1811 5 років тому
thankyou for this serious
@jojojawjaw
@jojojawjaw 5 років тому
Thanks a lot. You're the best.
@BudiSantoso-er6cq
@BudiSantoso-er6cq 5 років тому
Nice Tutorial, thanks..God Bless You..
@michaelffasd23
@michaelffasd23 6 років тому
Excellent tutorial, great for anyone starting out with REST API!
@academind
@academind 6 років тому
Thank you so much for your comment Michael!
@ArmandoBN497
@ArmandoBN497 4 роки тому
You are awesome! Have made me understand this finally! Keep up the awesome work this really means a lot to me, being able to understand all of this
@israelruas948
@israelruas948 3 місяці тому
Thank you so much for all your help.
@oilcanbland
@oilcanbland 4 роки тому
Max, I love you man! Been taking your courses for a couple years now. As of Feb 2020, is this serious still still wiable and up to date? Thanks dude!
@MrAuro
@MrAuro 3 роки тому
I almost never comment on tutorials, but this was a really good tutorial. It was short and I feel like I actually learned things instead of just copying code. 👍
@DJCreeperNo1
@DJCreeperNo1 2 роки тому
can confirm, i'm working on a site and the front-end was somewhat easy, the backend is a nightmare for my mind, this really cleared some misunderstanding "hooks" that i had for express JS
@arshamazami159
@arshamazami159 3 роки тому
Thank you for your useful courses thank you 😊
@icitywork7731
@icitywork7731 6 років тому
Keep them coming, can 't wait for the next one :)
@academind
@academind 6 років тому
Awesome to read that you like the series, next part coming soon!
@alexnezhynsky9707
@alexnezhynsky9707 6 років тому
Getting closer and closer to 100k subs! Great job, Max! 👍 Awesome content and presentation. Love your channel!
@academind
@academind 6 років тому
That's indeed so awesome Alex, I'm so happy to see how the channels keeps growing thanks to all of you guys! Also thanks a lot for your amazing feedback :)
@ezzoubeirelasraoui7839
@ezzoubeirelasraoui7839 4 роки тому
Thank you so much sir !!!!!
@abdulrahamanolatunde6548
@abdulrahamanolatunde6548 6 місяців тому
Hi Maximilian, thank you for all the knowledge you have being pouring out. This is the second programming language I will be learning with your materials. The first one was from Udemy and I really enjoyed it. Talking of PHP, I'll like to ask if you have a PHP course for building Restful APIs. If yes, please share the link as I've looked around for it and can't find it. If no, do you have plans of making one soon?
@nileshkharat1188
@nileshkharat1188 3 роки тому
mind blowing man, the best tutorial on the youtube platform, beginners and experience both required a explanation like you, hats of you man.... MAX you are a legend. Thanks a lot for this tutorial
@lightlover78
@lightlover78 4 роки тому
Thank you!
@mohamedyassinekhlif
@mohamedyassinekhlif 4 роки тому
Keep up the good work dude ;)
@dmytro.turskyi
@dmytro.turskyi 7 місяців тому
Hi Maximilian, thank you for the informative video on creating a REST API with Node.js. I found your explanations and step-by-step process really helpful. I noticed that you used pure JavaScript for your backend application. I was wondering what your thoughts were on using TypeScript instead. TypeScript has some great benefits like static typing and improved code maintainability. Was there a specific reason why you chose not to use TypeScript in this particular project? I'd love to hear your perspective on this. Thanks again for sharing your knowledge through these videos!
@bloxzyo
@bloxzyo 2 роки тому
Why does he use both express and http? Express is enough to get the job done in this video..... I am confused....
@ambyudo6958
@ambyudo6958 6 років тому
Thank you for your tutorial, how can we implement NodeJS- base API which will give the results of an SNMP poll of a remote server, having snMp community string, snmp OID1 and snmp OID2, remote server IP any address with port 161, Thanks
@jerrysmith3014
@jerrysmith3014 4 роки тому
Max awesome content! I'm researching a Reference error: Process is not define. I'm researching this but the documentation is not clear to me. Any Help is received with gratitude.
@mj25423
@mj25423 4 роки тому
You are amazing. Thanks a lot for the tutorials, it is so so simple explanation and the first time without any hiccups something works without set up issues!
@academind
@academind 4 роки тому
Happy to read that, thanks a lot!
@LesJoee
@LesJoee 6 років тому
that's helpful.thanks man you doing well
@academind
@academind 6 років тому
Thank you so much for sharing this Jesse :)
@Shree79124
@Shree79124 6 років тому
Great man.. Now I finally decided to create API's with NodeJS .
@academind
@academind 6 років тому
Awesome! Thanks for your great feedback Sachin!
@manmohangupta6905
@manmohangupta6905 6 років тому
Sir you are really great I have ever seen such type of teaching way like you thanks so much for making people happy and evolve the world using technology . I am from india and u are really great thanks so much again and namaste ..
@academind
@academind 6 років тому
Thank you so much Manmohan, that's just amazing to hear! :)
@SampathLokuge
@SampathLokuge 6 років тому
Supper cool. Thanks a lot Max :)
@academind
@academind 6 років тому
Thank YOU for your awesome feedback Sampath!
@hamzajaved6110
@hamzajaved6110 Рік тому
Thanks learn a lot from your vedio 😎 amazing bro
@aiduongtran6653
@aiduongtran6653 4 роки тому
thanks a lot bro
@jamesgarcia5221
@jamesgarcia5221 4 роки тому
Nice one, thank you
@logicstv
@logicstv 4 роки тому
This setup of express server , is it something that shroud be perceived as intuitive or I should memorize the code?
@tarasenkoalexander4607
@tarasenkoalexander4607 5 років тому
For newcomers: You can use server.use(app); // app is imported from app.js server.listen(8000, () => { console.log('App is listening on port 8000!') });
@shwetadubey9238
@shwetadubey9238 4 роки тому
can you tell me what is the differnce beween this code and Max sir coe because i am in newcomers in node js
@shwetadubey9238
@shwetadubey9238 4 роки тому
Thnku but this code worked it
@shubhamdubey4691
@shubhamdubey4691 5 років тому
I see Max , I like the video.
@nareshkollipora5323
@nareshkollipora5323 3 роки тому
Helpful Lecture
@vinothkumarv9722
@vinothkumarv9722 3 роки тому
Bro you are great did well.. very good explanation.... love you brother. :)
@isoplayers
@isoplayers 5 років тому
I saw a SO post saying that "--save" is no longer needed because it automatically adds the dependency to package.json. For some reason, it doesn't work for me. So is it still needed?
@sarimali8853
@sarimali8853 4 роки тому
Excellent 👌👍 brother
@fareed7753
@fareed7753 2 роки тому
A perfect teacher to learn any CS technology! Keep it up Man!
@leandrolavore4068
@leandrolavore4068 5 років тому
Max, junge, by far the best tutorials around. I am over 30, never coded before, just got into it like three months ago and learning a lot. Owe you a big deal. Thanks a lot.
@academind
@academind 5 років тому
Thanks so much Leandro, I wish you all the best on your programming journey :)
@elprincipito1704
@elprincipito1704 5 років тому
Hello there!! I am trying ot create my restful Api resources using node js, howvere our compnay uses apache web server. Do i need to install Node js in our server? or can i just use the methods you are curently expaling and installl node js as a dependency in my project. Thanks! Tonathiu
@amikkaaski9107
@amikkaaski9107 2 роки тому
This video is the most apt to my project even after 4 years of its release. Just want to say thank you, to Academind!
@bashar042
@bashar042 Рік тому
You are awesome!!
@dragomirtachev5553
@dragomirtachev5553 6 років тому
Love the way you show how things add up and they way they fit together
@academind
@academind 6 років тому
Thank you, makes me really happy to read that you like my explanations!
@rotrose7531
@rotrose7531 6 років тому
Thank you, it gives me what api is for the first time. Please create more and more enlightening tutorials like this.
@academind
@academind 6 років тому
Thanks for your awesome feedback! I'll try my best!
@Andrey-il8rh
@Andrey-il8rh 6 років тому
Max, did you think of using babel-watch inside the project? It allows using 'import' style syntax as well as all new but yet unsupported features of ES 2017
@academind
@academind 6 років тому
I considered a more complex setup but decided against it to keep the project/videos focused on the core of the series, which of course is building the RESTful API itself
@michaelrandall6954
@michaelrandall6954 3 роки тому
Hello Max, I see that you are running this, I assume on a local machine. How would I deploy this to an azure resource. I have limited access to azure resources, but I was thinking that I could create a ubuntu linux vm and would I install apache and then bundle this code and put it in the http directory or would I install node on the linux box and then not sure of my options.
@fmaransatto
@fmaransatto 5 років тому
awesome!
@ilgorxoja1910
@ilgorxoja1910 Рік тому
thank you
@UsamaKhan-um3nr
@UsamaKhan-um3nr 6 років тому
your knowledge is awesome and also have neat and clean voice also good your explanation about any topics. thank you.
@academind
@academind 6 років тому
Really great to read that Usama, thank you very much for your wonderful feedback :)
@ramithalasath8791
@ramithalasath8791 3 роки тому
Thank you very much for this tutorial series. It's very helpful and it's same as my project 😁
@balajis456
@balajis456 3 роки тому
This is helpful, also purchased angular course on Udemy. Love your teaching style.
@pigpig333666999
@pigpig333666999 6 років тому
太棒了!
@jayem3662
@jayem3662 6 років тому
thank you for the tutorial. btw, is the server.js is necessary if I'm in react native for mobile dev and planning to use this tutorial? I mean, that "http" thing. please reply, I would appreciate so much. :)
@academind
@academind 6 років тому
You need to spin up the Node.js server - the file can be named whatever you want though. But the content is important, yes
@shwetaverma4770
@shwetaverma4770 3 роки тому
Sir I am not able to see part 1 of this API series..can you share the link of part 1
@ManishYadav-qe6lk
@ManishYadav-qe6lk 6 років тому
i am getting events.js:183 error can you help me and how to remove all ready used port
@cruzjurado5471
@cruzjurado5471 6 років тому
What is that package-lock file when you add express? (min 5:24 aprox)
@MrEffg
@MrEffg 6 років тому
package-lock.json is automatically generated for any operations where npm modifies either the node_modules tree, or package.json . It describes the exact tree that was generated, such that subsequent installs are able to generate identical trees, regardless of intermediate dependency updates. (c) npm documentation
@cruzjurado5471
@cruzjurado5471 6 років тому
thanks!
@peekpt
@peekpt 6 років тому
I use RESTFUL APIs on mobile apps but never ever built a restful server. I am learning from you. Also following your tip and learning Vue . I have a question: I'm having trouble in memorizing all the different programming languages syntax . I do C for micro controllers, swift for iOS, now javascript, including css html. How do you do it? what is your trick? Thank you Max.
@andreasweber952
@andreasweber952 4 роки тому
I am using the vscode Extension "Rest Client" instead of Postman which is good to share the API Requests which each other working on the same code.
@mattdaroo2790
@mattdaroo2790 3 роки тому
thanks for the tip!
@noohusyed
@noohusyed 6 років тому
I installed node express with sucess, in server.js im getting red squigly(sorry for spelling) under re in require('http'). Am i missing somethkng? Thanks
@mq101t
@mq101t 6 років тому
thanks for this video is so cool,but way you make a server in native node and don't use express "app.listen(port ,function () { console.log('listening at ' + port); })" it just question ? and thanks again :)
@jakubrpawlowski
@jakubrpawlowski 6 років тому
I always wondered about the same thing when watching last two express series on this channel. Why not just app.listen Max?
@academind
@academind 6 років тому
Simply a habit - you can use both, that's absolutely true
@jakubrpawlowski
@jakubrpawlowski 6 років тому
Thanks for a quick reply as always! Do you ever REST? :P
@Andrey-il8rh
@Andrey-il8rh 6 років тому
Not really an efficient habit, though. I agree with other guys that this pattern feels odd
@jakubrpawlowski
@jakubrpawlowski 6 років тому
Andrey Bogdanov actually I realized that if you want to have http, https and websockets all using one connection then you need to do it the http.createserver way :p
@kurtke1990
@kurtke1990 5 років тому
Does anyone know what is difference using app.listen(port) and using http to create a server and listen to the port ?
@suryachaturvedi5036
@suryachaturvedi5036 4 роки тому
not working. server is running but not showing on local host
@shyarxelil1987
@shyarxelil1987 4 роки тому
Why dont you use express instead of using http module? For example you could just like so: const express = require('express') const app = express() const port = 3000 app.get('/', (req, res) => res.send('Hello World!')) app.listen(port, () => console.log(`Example app listening on port ${port}!`))
@cinquain0
@cinquain0 5 років тому
Fire!
@akapoolka8325
@akapoolka8325 6 років тому
Why can we omit file extension at 11:01? We don't use web pack, which as you, Max, have explained in React course on Udemy, handles the file extensions, including .js and .jsx files. Did you I misunderstand you?
@20cmusic
@20cmusic 6 років тому
'require' is one of the core functions of node.js. If there is no file extension, require function automatically add '.js' at the end of the parameter.
@ivan89pln
@ivan89pln 4 роки тому
Hello, nice video but i only dont understand why you start the app using pure nodejs code instead of expressjs ? Is there any reason for that ?
@sarimali8853
@sarimali8853 4 роки тому
It's working
@shreshthsingh7744
@shreshthsingh7744 3 роки тому
I hope these APIs could also be used in flutter?
@lesegoseikali2422
@lesegoseikali2422 Рік тому
When creating the "app.use" what does the => represent?
@shwetadubey9238
@shwetadubey9238 4 роки тому
TypeError: 'caller', 'callee', and 'arguments' properties may not be accessed on strict mode functions or the arguments objects for calls to them..i got the error when run on node js..please help me
@Ecdetails
@Ecdetails 5 років тому
Think about everything max does support him by getting his courses on udemy they are all amazing thanks for this tutorial
@academind
@academind 5 років тому
Thanks so much for your great feedback and for your support here and on Udemy Eddie! This honestly means a lot to me!
@ambientsoda106
@ambientsoda106 3 роки тому
but if I host node on a goddady server, in need to use node on my laptop to setup the files then use ftp to put them on the server - you cant work on node js as you are on the say goddady server..
@sujznamatya596
@sujznamatya596 5 років тому
I tried the same code and the page does not works where as i did const server = http.createServer(app); but does not works. any suggestion plz
@MayOcampo
@MayOcampo 6 років тому
I got no response on linux mint... got timeout error... what am i missing here?
@gaborballa9614
@gaborballa9614 4 роки тому
100% work on linux mint
@viniciusvelloso1575
@viniciusvelloso1575 3 роки тому
In my case, it was a typo ('http.createServer()' instead of 'http.createServer(app)').
@shakhawathossainshahin1225
@shakhawathossainshahin1225 3 роки тому
@@viniciusvelloso1575 thanks man. saved my day...
@mattdaroo2790
@mattdaroo2790 3 роки тому
I ended up using server.listen(3300); use app.listen(3300, () => console.log(`Listening on port ${port}...`)); This will use the express server, not the http server.
@mattdaroo2790
@mattdaroo2790 3 роки тому
@@viniciusvelloso1575 That's true and it works. I completely missed it in the video when he typed the app as a parameter
@mdvenkateshnuhk8034
@mdvenkateshnuhk8034 5 років тому
Thanks but i am little confused about what will be the 3 rd parameter that browser takes in app.use((req,res,next) [i mean next parameter ]
@romainjacquel1698
@romainjacquel1698 5 років тому
next moves to the next operation. function Todo () { // Your code next () }
@kalpeshpatil741
@kalpeshpatil741 3 роки тому
good information :)
@nabeeltahir6013
@nabeeltahir6013 5 років тому
Humble request to make tutorial ticket system using Laravel
@vijaypawar2176
@vijaypawar2176 5 років тому
Awesome
@saisreenivas1003
@saisreenivas1003 6 років тому
max can you explain callback hell in nodejs and how to avoid it
@academind
@academind 6 років тому
Hi, check this video - it should explain everything you need (it applies for Node.js, too): ukposts.info/have/v-deo/opeIopmaoY6DlX0.html
@daniellaerachannel
@daniellaerachannel 6 років тому
great teacher
@academind
@academind 6 років тому
Happy to read that, thank you very much!
@stanlyqqark5744
@stanlyqqark5744 6 років тому
Спасибо за уроки!
@MS-xu1ks
@MS-xu1ks 4 роки тому
Can't we use PUT instead of PATCH?
@user-zb5jp4ti1d
@user-zb5jp4ti1d 6 років тому
Max... may i ask a quick query abt nomenclature... REST and RESTful... when do we use one or the other
@academind
@academind 6 років тому
REST is simply just the shorter form of RESTful :)
@user-zb5jp4ti1d
@user-zb5jp4ti1d 6 років тому
Academind got it. Thank you
@UsamaShafqatKhan
@UsamaShafqatKhan 5 років тому
I’m using the vs code and I’ve installed the recommended extensions for work with node js but i don’t get the intellisense like yours.
@ss2851
@ss2851 4 роки тому
Install required package from within VS Code
@yigitruzgaruzun7289
@yigitruzgaruzun7289 4 роки тому
You are wonderful. ı speak foreign language than you. but you taught this lesson to me awesome. Thanks
@academind
@academind 4 роки тому
Happy to read that, thank you for your comment!
@yigitruzgaruzun7289
@yigitruzgaruzun7289 4 роки тому
@@academind Thanks :)
@antonioguiotto529
@antonioguiotto529 5 років тому
bro u damn good at what u do
@academind
@academind 5 років тому
Thanks so much Antonio, this really means a lot to me!
@antonioguiotto529
@antonioguiotto529 5 років тому
@@academind by the way your current logo rock balls
@brotherx6205
@brotherx6205 4 роки тому
could this work with a react js application?
@El_ii
@El_ii 4 роки тому
Yes
@nicklowe_
@nicklowe_ 4 роки тому
This is a great serious
@academind
@academind 4 роки тому
;)
@88noname88
@88noname88 4 роки тому
Do you know why he using http wrapper. We can use express app.listen(PORT) without http library
@searchbarwebs
@searchbarwebs 6 років тому
Will this series get me going with Node.js if i havent used it before?
@academind
@academind 6 років тому
Maybe to some extent but I won't dive into all the Node.js basics in this series. I got another series that does that: ukposts.info/slow/PL55RiY5tL51oGJorjEgl6NVeDbx_fO5jR (audio quality unfortunately is a bit bad, sorry about that)
@67Diadem
@67Diadem 4 роки тому
localhost:3000 is not working in postman and in web browser.. please help!!!
@mattdaroo2790
@mattdaroo2790 3 роки тому
Instead of server.listen(3300); use app.listen(3300, () => console.log(`Listening on port ${port}...`)); This will use the express server, not the http server.
@mattdaroo2790
@mattdaroo2790 3 роки тому
@11:13 It should be http.createServer(app); and not http.createServer();
@MrGowrishankar007
@MrGowrishankar007 4 роки тому
Can you please let me know the editor software you were used
@academind
@academind 4 роки тому
I'm using Visual Studio Code.
@wederpacheco1470
@wederpacheco1470 6 років тому
Max, i am still missing a node.js complete udemy course. Can we hope for it any time in a close future? That would be neat! Great video btw!
@academind
@academind 6 років тому
No concrete plans as of now to be honest but we'll see - Node certainly is an interesting topic. Thank you for your comment Wéder, awesome to read that you like the video!
@PavanKumar-vu2mm
@PavanKumar-vu2mm 6 років тому
Yes! We need a course from you on nodejs and mongodb!
@shivamkakkar27
@shivamkakkar27 4 роки тому
Welcome back to this serious
@academind
@academind 4 роки тому
;)
@hemanthvarmas
@hemanthvarmas 4 роки тому
at 12:22 I am not able to get the same page on my browser, instead I am getting a page that keeps on loading. Please help!
@BabyBoyViraj
@BabyBoyViraj 4 роки тому
Even I am facing the same issue not sure what is the problem. Help needed
@BabyBoyViraj
@BabyBoyViraj 4 роки тому
In server.js , while creating server pass the app parameter and it will work
@hemanthvarmas
@hemanthvarmas 4 роки тому
@@BabyBoyViraj Thanks! It worked.
@lifeofyusufkerem
@lifeofyusufkerem 3 роки тому
@@BabyBoyViraj Thank you so much!
@rahulshukla9005
@rahulshukla9005 5 років тому
how to use single node js api for mobile app(android/ios) and web(template engine) both?
@redtech9204
@redtech9204 5 років тому
RESTful api is what is used for both as it recieves and sends data only. It doesn't care about the clients or what the client see's such as html styled with css, or the document object model. It only cares about the data that's sent and recieved.
@redtech9204
@redtech9204 5 років тому
It's not necessarily node.js but the api you create if that makes sense.
@MrPhiineasKK
@MrPhiineasKK 6 років тому
Is it bad practice to start the server like this? app.listen(port, ()=>{ console.log('Server started on port '+port); });
@bottletyre
@bottletyre 6 років тому
Please post what is the best way ?
@MrPhiineasKK
@MrPhiineasKK 6 років тому
Srry, i forgot the '?' That was a question if the code above was bad practice, because he did it in a different way!!
@mq101t
@mq101t 6 років тому
??this reply for my question
@MrPhiineasKK
@MrPhiineasKK 6 років тому
No, just another question that happened to be the same :)
Adding More Routes to the API | Creating a REST API with Node.js
17:05
You might not need useEffect() ...
21:45
Academind
Переглядів 120 тис.
Web Developer Roadmap (2024) - Everything is Changing
25:02
ByteGrad
Переглядів 197 тис.
Big Tech AI Is A Lie
16:56
Tina Huang
Переглядів 35 тис.
NodeJS 22 Just Dropped, Here's Why I'm Hyped
14:31
Theo - t3․gg
Переглядів 73 тис.
Managing Orders with Mongoose | Creating a REST API with Node.js
22:05
What is a REST API?
9:12
IBM Technology
Переглядів 1,4 млн
Why node.js is the wrong choice for APIs (and what to use instead)
5:48
DevOps For Developers
Переглядів 73 тис.
How I would learn & master it if I were to start over again
29:47
Academind
Переглядів 95 тис.