Express.js Tutorial: Building RESTful APIs with Node Express Get the COMPLETE Course (70% OFF – LIMITED TIME): http://bit.ly/2NduewZ Subscribe for more …
Original source
Express.js Tutorial: Building RESTful APIs with Node Express Get the COMPLETE Course (70% OFF – LIMITED TIME): http://bit.ly/2NduewZ Subscribe for more …
Original source
47 responses to “Express.js Tutorial: Building RESTful APIs with Node and Express”
You're awsome!!!!!
Thanks
Nice tutorial.
Even if that one line "if" statement is disgusting :/
It is not "more elegant", it just takes less height
Hey, great tutorial but one question. When trying to do the put function, even when I use "name": "new course" I always get the message "name" is required. (copied your code exactly I think) Any ideas why this might be happening?
how to post the json object to external api call from app.post? am getting error like missing authorization header. i didn't find any auth for that api call.
am new to node.js and express.js
In one sentence , This lecture is awesome Mr. Mosh. thanks.
I keep wanting to press on the Setting icon and install the update.
Thank you for the course and I bought your course few days ago. 😀
Hi Mosh, thanks a lot for sharing this tutorial with us.
I have a question regarding the line:
const course = courses.find(c => c.id === parseInt(req.params.id));
where you have used 'c' at time 28:41 in your video.
Could you please explain me how this work. Or may be provide me the name of the convention so that I can research myself.
Thank you!!
super video
Very good tutorial Mr. Mosh..Things are organised very well…Nothing is more or less..Good effort….Thank u…
Hi your tutors ares simply awesome . can i have the information about how to configure mysql database in REST API using express instead Mongo.
Great tutorial. I always like it when an instructor can admit that there was a bug in what they were coding. Very humble and I like seeing the trouble shooting that the teacher goes through. Great course, I am studying writing smart contracts for cryptocurrencies, and originally watched your video because it came up in a list of videos under the query 'json'. Very fortunate that I found your work, I will be back to udemy to take your course!
Bought the course which is ok but everyone should know that after you buy the course you get 'ZERO' support from Mr. Mosh or the team … you are completely on your own … they DO NOT offer any help or support what so ever … I've bought other courses from other sources also and they're not only cheaper but also they provide a lot of help afterward, but not here … so be careful all !! This is what I get repeatedly from Mosh's team: "Hi,
Due to the large volume of requests, we can not offer technical support or answers to individual questions at this time. If you have more generic questions, it may be best to post them on stackoverflow.com.
Thank you so much!" … and they don't have any support forum either, trust me I've asked …
Excellent video. Very well structured. thanks
I've been a c# dev for about 7 years and wanted to learn new technologies like nodejs and this video is great to start with. Thanks Mosh
I was struggling learning how to create a server with node and express. This tutorial is really easy to understand and well-structured for beginners. This is so far the best tutorial on Youtube!!! Thank you so much, Mosh!!!
Sir I have problems
When I hit api/courses then I have one message on browser
Cannot Get /api/courses
Please help
Very informative – Thanks a lot
Massive thanks. This helped me a lot.
hi Mosh. I realy love your courses, very beatiful explanations of hard things. But appeared a problem by my side. Could it's possible to give a hand?
I stopped on Input validation, I did all that I needed. The versions of Joi, express..and the code is absolutely similar. I installed postman, but it validate all requests even integers; I tryied many variants, but it likes filters of Joi doesn't work on my PC. I'll try on ubuntu 16.04. Below is the code:
const Joi = require('joi');
const express = require ('express');
const app = express();
app.use(express.json());
const courses=[
{ id:1, name:'course1'},
{ id:2, name:'course2'},
{ id:3, name:'course3'},
];
app.get('/', (req, res)=>{
res.send('ok');
});
app.get('/api/courses', (req, res)=>{
res.send(course);
});
app.post('api/courses', (req, res) => {
const schema={
name: Joi.string().min(3).required()
};
const result = Joi.validate(req.body, schema);
if(result.error){
res.status(400).send(result.error.details[0].message);
return;
}
});
app.post('/api/courses', (req, res)=>{
const course ={
id:courses.length+1,
name: req.body.name
};
courses.push(course);
res.send(course);
});
app.get('/api/courses/:id', (req, res)=>{
const course = courses.find(c=>c.id===parseInt(req.params.id));
if(!course) res.status(404).send('The course with given ID is not found');
res.send(course);
});
const port = process.env.PORT || 3000;
app.listen(port, ()=> console.log(`listening on ${port}…`));
SAILS. JS or ADONIS.JS rest api please with jwt auth
YOU DESERVE IT
Knew most of this, but I still watched the entire tutorial because it was so incredibly well structured and didactic.
You are a born teacher. I've often fantasized about making great and clear youtube tutorials, in my wildest most perfect fantasies, they looked exactly like the stuff you actually make! Incredible!
one of the best tutorial on node.js.awesome,keep it up!
Awesome tutorial, very helpful
This is THE cleanest api tutorial I have seen yet! It's just absolutely phenomial! Very well structured and easy to follow. Will be creating a basic orders api, and this will help!
thanks your explain is wonderful..
Very professional teaching..
Moish, you are bomba.
How do you know what will be returned from the request " require("module_name") " .
For example you said require("express") returns a function and require("joi") returns a class. I am wondering where i can find those information.
Man! this for far one of the best well explained Node+Express crash courses I've ever seen. You convinced me to buy the full series 🙂
one more potential check: the course id passed may not be a parseable int. one needs to test / return error message. so a suggested order for input validation might be (i) is the id parseable, (ii) is the message valid, and then (iii) does the id exist. looking up the id (step iii) is the most expensive one and should only be performed after all pre-requisites are satisfied.
at 28:00, in courses.find() i would move parseInt(req.parameters.id) to the outside of the find(), so parseIntI() is not called for every element, i.e.:
const id = parseInt(req.params.id);
const course = courses.find(c => c.id === id);
thoughts?
amazing quality of teaching. congrats
i am sorry but i do not understand why you are using a c (minute 27) what is it reffrencing?
Cool video… very helpful.
I love this lecture, your speaking manner, pace and explanations are ideal. Not too much detail but just enough. Background music also helps with concentration.
I want with the database work? from where can I get?
That zoom fucked up my brain
Thank you for this video Mosh. It has helped me a lot! Unfortunately, my school does not teach any web development for computer science students…. lol
Hi Sir, i took your Angular course… and i made oshop till the end… from then i've been a great fan of you….. never seen such a great teacher…..!!!
I think would be great if you post it in difference video instead of in a single ones
We love you Mosh
loopback and express , what is the best.??
I have some sort of problem with joi library. It fails to load with unexpected token in index.js of joi
your website is not displaying favicon 😀
At 27:00 what does c represent
I find your curricula competencies and content spreading strategies accurate and efficient. It looks like a dominos effect learning. I never coded with Express.js. and I really got all the logic behind it easily .
Thanks for this great course.
Your videos helped me expand my knowledge thank you so much for your interest in teaching what you have learnt in a very clear & precise manner. Appreciate it!