Planning & First Steps | Creating a REST API with Node.js
Vložit
- čas přidán 28. 11. 2017
- 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!
Max has been teaching me to be a better developer for three years now! Let's goooo! 😊😊😊😊😊
THANK YOU for this! Very helpful!
Best nodejs walkthrough on CZcams
thank you
Academind
for this part
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. 👍
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
Excellent tutorial, great for anyone starting out with REST API!
Thank you so much for your comment Michael!
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
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
Getting closer and closer to 100k subs! Great job, Max! 👍 Awesome content and presentation. Love your channel!
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 :)
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
thankyou for this serious
Thanks a lot. You're the best.
Keep them coming, can 't wait for the next one :)
Awesome to read that you like the series, next part coming soon!
Nice Tutorial, thanks..God Bless You..
Thank you so much for all your help.
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!
Happy to read that, thanks a lot!
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!
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!')
});
can you tell me what is the differnce beween this code and Max sir coe because i am in newcomers in node js
Thnku but this code worked it
Thank you for your useful courses thank you 😊
Great man.. Now I finally decided to create API's with NodeJS .
Awesome! Thanks for your great feedback Sachin!
This video is the most apt to my project even after 4 years of its release. Just want to say thank you, to Academind!
that's helpful.thanks man you doing well
Thank you so much for sharing this Jesse :)
Supper cool. Thanks a lot Max :)
Thank YOU for your awesome feedback Sampath!
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.
Thanks so much Leandro, I wish you all the best on your programming journey :)
Keep up the good work dude ;)
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 ..
Thank you so much Manmohan, that's just amazing to hear! :)
A perfect teacher to learn any CS technology! Keep it up Man!
Thank you so much sir !!!!!
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?
Thank you!
Thank you, it gives me what api is for the first time. Please create more and more enlightening tutorials like this.
Thanks for your awesome feedback! I'll try my best!
Thanks learn a lot from your vedio 😎 amazing bro
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!
Nice one, thank you
Love the way you show how things add up and they way they fit together
Thank you, makes me really happy to read that you like my explanations!
Bro you are great did well.. very good explanation.... love you brother. :)
I see Max , I like the video.
You are awesome!!
Excellent 👌👍 brother
Why does he use both express and http? Express is enough to get the job done in this video..... I am confused....
Helpful Lecture
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
thanks a lot bro
Thank you very much for this tutorial series. It's very helpful and it's same as my project 😁
awesome!
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.
your knowledge is awesome and also have neat and clean voice also good your explanation about any topics.
thank you.
Really great to read that Usama, thank you very much for your wonderful feedback :)
Fire!
This setup of express server , is it something that shroud be perceived as intuitive or I should memorize the code?
great teacher
Happy to read that, thank you very much!
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?
This is helpful, also purchased angular course on Udemy. Love your teaching style.
good information :)
Think about everything max does support him by getting his courses on udemy they are all amazing thanks for this tutorial
Thanks so much for your great feedback and for your support here and on Udemy Eddie! This honestly means a lot to me!
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
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
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}!`))
太棒了!
It's working
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.
thanks for the tip!
Awesome
When creating the "app.use" what does the => represent?
Does anyone know what is difference using app.listen(port) and using http to create a server and listen to the port ?
i am getting events.js:183 error can you help me and how to remove all ready used port
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
not working. server is running but not showing on local host
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.
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
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
Sir I am not able to see part 1 of this API series..can you share the link of part 1
Спасибо за науку! Разговорный английский плохо понимаю, но тут всё интуитивно понятно )
Welcome back to this serious
;)
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.
This is a great serious
;)
Спасибо за уроки!
You are wonderful. ı speak foreign language than you. but you taught this lesson to me awesome. Thanks
Happy to read that, thank you for your comment!
@@academind Thanks :)
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 :)
I always wondered about the same thing when watching last two express series on this channel. Why not just app.listen Max?
Simply a habit - you can use both, that's absolutely true
Thanks for a quick reply as always! Do you ever REST? :P
Not really an efficient habit, though. I agree with other guys that this pattern feels odd
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
I got no response on linux mint... got timeout error... what am i missing here?
100% work on linux mint
In my case, it was a typo ('http.createServer()' instead of 'http.createServer(app)').
@@viniciusvelloso1575 thanks man. saved my day...
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.
@@viniciusvelloso1575 That's true and it works. I completely missed it in the video when he typed the app as a parameter
I hope these APIs could also be used in flutter?
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?
'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.
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. :)
You need to spin up the Node.js server - the file can be named whatever you want though. But the content is important, yes
bro u damn good at what u do
Thanks so much Antonio, this really means a lot to me!
@@academind by the way your current logo rock balls
What is that package-lock file when you add express? (min 5:24 aprox)
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
thanks!
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 ]
next moves to the next operation.
function Todo () {
// Your code
next ()
}
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..
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
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 ?
Can't we use PUT instead of PATCH?
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.
Install required package from within VS Code
This is a good serious
Happy to read that you like it, thank you!
Will this series get me going with Node.js if i havent used it before?
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: czcams.com/play/PL55RiY5tL51oGJorjEgl6NVeDbx_fO5jR.html (audio quality unfortunately is a bit bad, sorry about that)
max can you explain callback hell in nodejs and how to avoid it
Hi, check this video - it should explain everything you need (it applies for Node.js, too): czcams.com/video/jgWnccjXR4I/video.html
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!
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!
Yes! We need a course from you on nodejs and mongodb!
who faces with the =>(unexpected token) problem ?
localhost:3000 is not working in postman and in web browser.. please help!!!
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.
@11:13 It should be http.createServer(app); and not http.createServer();
Humble request to make tutorial ticket system using Laravel
Do you know why he using http wrapper. We can use express app.listen(PORT) without http library
Max... may i ask a quick query abt nomenclature... REST and RESTful... when do we use one or the other
REST is simply just the shorter form of RESTful :)
Academind got it. Thank you
Why cant we use sessions in SPA?? People are using it with Angular.
could this work with a react js application?
Yes
Which vs code extensions are you using?
I only use the "Angular Essentials" pack