Node.js Rest API With Restify, Mongoose, JWT - Part 1

แชร์
ฝัง

ความคิดเห็น • 118

  • @raghul7211
    @raghul7211 6 ปีที่แล้ว +79

    Thank you brad! You are a major part in my technical life. I ended up with a full time job as a web developer. Thank You soo Much

    • @vladimirmikulic7860
      @vladimirmikulic7860 6 ปีที่แล้ว +3

      Raghul Reerag congratulations. About job interview, how was it, what questions you were asked? I know that this sounds silly, but for a 15 y/o its a life saver. I am so nervous about tech. I know Linux adminstration, I have book on networking that I am reading and I am programming. So if you could explain a little more about your job, your tech stack, interview I'll be very grateful to you.

    • @raghul7211
      @raghul7211 6 ปีที่แล้ว +1

      @@vladimirmikulic7860 just go with your passion , its gonna 100% benefit you. The only thing you have to do is to try being better than yesterday. All the best for all your future endeavors !

    • @vladimirmikulic7860
      @vladimirmikulic7860 6 ปีที่แล้ว +1

      Raghul Reerag thanks :)

    • @TraversyMedia
      @TraversyMedia  6 ปีที่แล้ว +6

      Congrats man, that's awesome

    • @raghul7211
      @raghul7211 6 ปีที่แล้ว +1

      @@TraversyMedia Thank you, you are my man
      ❤️

  • @hussainisaiduadamu3327
    @hussainisaiduadamu3327 6 ปีที่แล้ว

    my goodness man. I spent my whole week on you youtube channel, was just trying to look up on some school assignment that didn't understand. now just going through all the videos man. can't thank you enough man.

  • @md.akib5124
    @md.akib5124 6 ปีที่แล้ว +7

    King Brad is back with another astounding tut. Love you man.

  • @rotimibest8530
    @rotimibest8530 6 ปีที่แล้ว +2

    Thanks mentor Brad. Just the time I had a project that needed a rest api on Node and Mongoose here u come with a tutorial. I am loyal to this Channel man..

  • @jfojw21dfs9
    @jfojw21dfs9 6 ปีที่แล้ว

    Good job Brad. I also use JWT as an auth method. I actually don't store it in database but rather send it to the front end as a query string. It's weird but works for my small applications.
    I used to store it in my MongoDB database but after a while I just got hundreds of JWTs in one single user, because these users don't properly log out.

  • @babak2011
    @babak2011 6 ปีที่แล้ว

    I had install Mongoose today and the version was 5.3.8, in few hours a new version came up after your tutorial :))

  • @nadir2k
    @nadir2k 6 ปีที่แล้ว +1

    Thank you very much brad, Just because of your tutorials, I am successfully creating production levels apps in nodejs

  • @CharlesGouin
    @CharlesGouin 6 ปีที่แล้ว

    Wow. I'm more than ready to go on another awesome Node.js adventure with you Brad!

  • @GeekMustHave
    @GeekMustHave 6 ปีที่แล้ว

    Originally I thought it was cool that you would do a video on something I was interested in. Now I'm beginning to think you are stalking my browser history. Just yesterday I was looking at what the hell JWT was and boom, here you are with videos. Just don't look at all my browser history ;-), keep broadcasting!!

  • @oxydol3456
    @oxydol3456 3 ปีที่แล้ว

    Thanks. As of May 2021, the content is not outdated and useful.

  •  6 ปีที่แล้ว +1

    Legend is back. Love you from VN

  • @przemekwolnik2560
    @przemekwolnik2560 6 ปีที่แล้ว

    Brad, another great tutorial! Thank you so much!
    One minor thing though. When trying to get a customer with not existing id (but the id is in the right format e.g. 5bd870aa926e2e8e82c6d979) you still get 200 status code. I guess it should return 404 not found. If so another check in try/catch is needed. The same goes for update and delete customer.
    Anyway, it's a great content and I'm looking forward to your next videos!

  • @indiansoftwareengineer4899
    @indiansoftwareengineer4899 6 ปีที่แล้ว +5

    Love you sir from India. Please make more tutorials.

  • @binayakgshankar9188
    @binayakgshankar9188 6 ปีที่แล้ว +5

    Let me be very frank: I follow Brad Traversy, Maximilian and Steve Colt. I owe them a lot. #BuddingGeek

    • @Colstonewall
      @Colstonewall 6 ปีที่แล้ว

      You should follow Sebastian too. CodingTheSmartWay th-cam.com/channels/LXQoK41TOcIsWtY-BgB_kQ.html

    • @JacquesvanWyk
      @JacquesvanWyk 6 ปีที่แล้ว

      Who is Steve Colt?

    • @justsomeguy8385
      @justsomeguy8385 6 ปีที่แล้ว

      You mean Colt Steele?

  • @letslearnabout4934
    @letslearnabout4934 6 ปีที่แล้ว

    Just when I was looking for Node REST videos!

  • @GonzaloGuevaraFreire
    @GonzaloGuevaraFreire 5 ปีที่แล้ว +1

    Excelente Brad muy buen video, claro y directo al grano.

  • @vickylance
    @vickylance 5 ปีที่แล้ว +1

    Is mongoose an ORM? Does it mean it can be used for other NoSQL databases?

  • @hlomphomota6002
    @hlomphomota6002 6 ปีที่แล้ว

    Wow, you are one busy person. I respect that...

  • @Suriprofz
    @Suriprofz 6 ปีที่แล้ว

    Graphql? Mobx? Your one of the best teachers out there

  • @cloudagnostic
    @cloudagnostic 6 ปีที่แล้ว

    Currently watching on my lunch break!

    • @cyrusmbithi649
      @cyrusmbithi649 6 ปีที่แล้ว

      In Kenya (Africa) it's around 9pm

  • @mealcode
    @mealcode 6 ปีที่แล้ว

    good timing I need this for a job. Thanks brad :)

  • @munapadhi8723
    @munapadhi8723 6 ปีที่แล้ว

    thank you brad for your amazing effort, i love your all video in you tube & eduonix .

  • @kevinzhang8974
    @kevinzhang8974 6 ปีที่แล้ว

    Very useful again .... now need to figure out how to squeeze time to code along. thank you!!!!

  • @biswajitbiswas4276
    @biswajitbiswas4276 6 ปีที่แล้ว

    Brad, I am always waiting for your videos.

  • @Zortheren
    @Zortheren 6 ปีที่แล้ว

    When using the promise method with .then() do I also need to use .next()? or does the resolve automatically hands over control to the other functions or whatever control gets handed to.
    I tried it with and without .next() and both ways seem to work, so Im not sure.

  • @lukebyrge3047
    @lukebyrge3047 ปีที่แล้ว

    Hello, I know I am a bit late to the party, but was trying to do this video as my first nodejs project. With next() no longer being allowed in async calls, how can you get restify-errors to work. I only get 500 returns on bad calls with the async routes.

  • @alexmachin1785
    @alexmachin1785 6 ปีที่แล้ว

    I was doing CCNA secuirty but damn Brad your videos are too good. #NotificationSquad

  • @GameOver7853
    @GameOver7853 6 ปีที่แล้ว

    I love it when someone says "JWT Token" like the T in jwt stands for something else 😂 By the way, thanks for the series Brad it's awesome so far! I feel like I'll be using Restify more now

    • @TraversyMedia
      @TraversyMedia  6 ปีที่แล้ว

      haha yeah I guess you have a point :)

  • @umairgul6232
    @umairgul6232 6 ปีที่แล้ว +1

    Thank you very much Brad, your tutorials are always neat and clean that everybody can learn,
    I have a question that What is the difference between findOneAndRemove and findOneAndDelete?

  • @attemptedcoding
    @attemptedcoding 6 ปีที่แล้ว

    I love this Brad! Thank you so much for this.

  • @simrandotdev
    @simrandotdev 6 ปีที่แล้ว +4

    It would be great if you could create few series using a SQL db and using sequelizejs.

    • @djBulba
      @djBulba 6 ปีที่แล้ว +1

      Yes, actually two sequelize series for MySQL, one for basic syntax (CRUD), then other one for complex operations like joins and using operator aliases

  • @degraphe8824
    @degraphe8824 6 ปีที่แล้ว

    I'm your biggest fan traversy
    Please keep up the good work

  • @marc536
    @marc536 6 ปีที่แล้ว +1

    at first glance, I think I like restify better than express.

  • @rileym3394
    @rileym3394 6 ปีที่แล้ว

    MLab seems very similar to MongoDB Compass.Whats the difference apart from one of the the two not requiring instalation on the local machine?

  • @argeelearner3978
    @argeelearner3978 6 ปีที่แล้ว

    Hell, this is CLUTCH! Thank for this vid!

  • @milosh996
    @milosh996 6 ปีที่แล้ว

    What is the best way to host a Node.js site? I have a Linux (Ubuntu) VPS with Apache, so is Phusion Passanger the best choice in my case?

  • @vishnudileesh1243
    @vishnudileesh1243 6 ปีที่แล้ว

    What's the view on running mongoDB instance on digital ocean droplet as the server droplet

  • @binayakgshankar9188
    @binayakgshankar9188 6 ปีที่แล้ว

    I am facing an issue. When I am creating username with '@'in mlab like gg@rt1 and password as @123adf, it throws an error on the console --- Unescaped at-sign in authority section. Please help, anyone.

  • @simonnice9030
    @simonnice9030 5 ปีที่แล้ว

    King Traversy. I study Web Programming to make my knowledge official, but most of the actual knowledge have come from your guides here on TH-cam and the in-depth courses on Udemy. I like to watch your Crash Courses on everything and then buy the Udemy Courses for topics that are more relevant to me especially. Any plans on making a course on Serverless with AWS Lambda?

  • @nice2meetyou631
    @nice2meetyou631 6 ปีที่แล้ว

    Hey Brad. When dealing with a function with callbacks I've seen you use the .then().catch() syntax but now you went with the async, await, try catch. Is that something you do just for variety? Do you prefer one method over the other? (I think we can all agree the nested callback method is out of the question). Which is the most conventional method that one would see used?
    Great videos as per usual.

    • @danielfs
      @danielfs 6 ปีที่แล้ว

      I am not Brad, but both are fine to use, I believe he used async/await in this tutorial just because he said in the beginning of the video that this is a very modern code. So, for this reason he's using async/await which came as a new tool in ES8 the lastest version of JS.

    • @devilmanscott
      @devilmanscott 6 ปีที่แล้ว

      Async await is used to make your code look more synchronous because most people prefer that style.
      While promise chains are a common pattern in functional programming.

  •  6 ปีที่แล้ว

    I've read through mLab's blog posts that they've merged with (or been bought by) MongoDB. Will you eventually make a small tutorial on how to transfer your mLab's databases and collections into MongoDB Atlas?

  • @Masterchief3ify
    @Masterchief3ify 5 ปีที่แล้ว

    Great tutorial! Really easy to follow.

  • @phamhalam2344
    @phamhalam2344 6 ปีที่แล้ว

    Hi Brad,
    I not connect to mongodb
    error : MongoParseError, Please help me

  • @DrDuck07
    @DrDuck07 6 ปีที่แล้ว

    hey brad, getting this error : MongoError: Authentication failed.
    at Function.MongoError.create.... have tried several methods to resolve but not working. pls help

  • @vaibhavsam100
    @vaibhavsam100 6 ปีที่แล้ว

    Hey Brad, can you also please cover the Unit testing part using Mocha and Chai for this App?

  • @TheKNdheeraj0
    @TheKNdheeraj0 6 ปีที่แล้ว

    How can I add ejs for frontEnd in a restify application??

  • @themoon51
    @themoon51 6 ปีที่แล้ว

    Can anyone explain the syntax on line 22? Specifically how encasing it in paraenthesis next to require works. Also, where I can read into it (docs). Thanks.

    • @mehra.akshit
      @mehra.akshit 5 ปีที่แล้ว

      require is just returning a function name, and you're invoking the function by adding parenthesis (and also passing an argument) after it.

  • @brianmlambo3306
    @brianmlambo3306 6 ปีที่แล้ว

    0:1 the come and seep knowledge sound

  • @DanielRLuke
    @DanielRLuke 6 ปีที่แล้ว

    Thanks, Brad. Thanks for all you do.

  • @rahulprajapati8052
    @rahulprajapati8052 6 หลายเดือนก่อน

    How can we create middleware in restify ?

  • @thavathrath7022
    @thavathrath7022 6 ปีที่แล้ว

    Thanks Brad. You helped me a lot of thing.

  • @runparisrun6512
    @runparisrun6512 6 ปีที่แล้ว

    For the get /customers/:id request. Sometimes (for some long id) mongoose returns null as customer. The try-catch could not catch the error. Then the server just return null for the request.Anyone knows what went wrong with mongoose? Program is exactly like on the video.

    • @runparisrun6512
      @runparisrun6512 6 ปีที่แล้ว

      And if i use id like the one on the video /customers/1 , that's ok. but if i use a long id like 5bd870e0926e2e8e82c6d973. Sometimes, the server returns null. although most of the time the server can catch the error. i don't know what happened there.

    • @runparisrun6512
      @runparisrun6512 6 ปีที่แล้ว

      Dig a little deeper, i found that the id should be 12 or 24 long. So when you use 123 as the id, your Try-Catch did catch the error that the id is NOT IN A CORRECT FORMAT. (not because the customer with the id don't exist). And if i use a id with correct format(12 or 24 characters long) then the query returns null, which means (i think) no customer is with that id. And this is where the server should return the customer not found error.

  • @DanielWeikert
    @DanielWeikert 6 ปีที่แล้ว

    method POST is not allowed. Any ideas? Thanks

    • @djBulba
      @djBulba 6 ปีที่แล้ว

      might be a CORS issue. you can check restify-cors-middleware which will allow you to make POST request

  • @vinibp
    @vinibp 6 ปีที่แล้ว

    Brad can you do a course about SaaS? I want to sell software online but my "trial users" keep on creating new accounts with fake e-mails, how I can sell my webapp more efficiently to prevent leeches from cheating on my 2-week trial system? Do a course and I'll definitely buy it!

  • @harrisonekpobimi4764
    @harrisonekpobimi4764 6 ปีที่แล้ว

    Lord Brad at it again

  • @alexweissnicht9545
    @alexweissnicht9545 6 ปีที่แล้ว +1

    Can you use typeorm in some videos? It is very great and works with different databases :-)

  • @masrooralykhan
    @masrooralykhan 6 ปีที่แล้ว

    Thanks brad such a amazing video

  • @adrianrobertdan6330
    @adrianrobertdan6330 5 ปีที่แล้ว

    Thank you dude ! Great tutorial!

  • @makariyu69
    @makariyu69 6 ปีที่แล้ว

    I miss you brad!

  • @tanveerulhoque6803
    @tanveerulhoque6803 6 ปีที่แล้ว

    at first i hit the like button then i watch the video

  • @kunwarsiddharth2780
    @kunwarsiddharth2780 6 ปีที่แล้ว

    whats the difference between findoneanddelete and findoneandremove???

    • @BestHKisDLM
      @BestHKisDLM 6 ปีที่แล้ว

      findOneAndRemove() executes the MongoDB db.collection.findAndModify() with remove: true option, while findOneAndDelete() executes MondoDB db.collection.findOneAndDelete().
      CheckMongoose API docs: mongoosejs.com/docs/api.html#query_Query-findOneAndDelete (remove is right below)

  • @vashantir
    @vashantir 6 ปีที่แล้ว

    So like, what if I don't want to use Mongo...........

  • @rickvandenbroek6869
    @rickvandenbroek6869 6 ปีที่แล้ว

    Mongoose is not really an ORM since MongoDB is a non-relational database, right?

    • @danko95bgd
      @danko95bgd 6 ปีที่แล้ว

      technically it's and ODM, object document mapper (you are mapping objects to those mongodb documents). ORM maps to relational dbs but here db consists of documents.

    • @TraversyMedia
      @TraversyMedia  6 ปีที่แล้ว

      Yes, ODM. I always make that mistake, sorry :(

  • @AbhishekKumar-mq1tt
    @AbhishekKumar-mq1tt 6 ปีที่แล้ว

    Thank u for this awesome video and series

  • @thatsenam9183
    @thatsenam9183 6 ปีที่แล้ว

    Loved NodeJS.

  • @gosnooky
    @gosnooky 6 ปีที่แล้ว

    Why are you still using require()?

    • @TraversyMedia
      @TraversyMedia  6 ปีที่แล้ว

      I don't want to use Babel and I don't like the experimental .mjs. I am waiting for native import in Node

  • @kelthuzal
    @kelthuzal 6 ปีที่แล้ว

    awesome vid, thanks for your effort

  • @sivasankarchimata1882
    @sivasankarchimata1882 6 ปีที่แล้ว

    Sir can you please make a video on MYSQL ANGULAR NODE.JS , I am looking for those tutorial from so many days ,

  • @nadir2k
    @nadir2k 6 ปีที่แล้ว

    Can you please please please do WordPress Headless Rest API with REACT , Please we really need it

  • @MMANJUNATH18
    @MMANJUNATH18 6 ปีที่แล้ว

    How to change timezone in mongoose timestamp

  • @temirkhanamanbaev42
    @temirkhanamanbaev42 4 ปีที่แล้ว

    Thank you very much, useful.

  • @sol0matrix
    @sol0matrix 6 ปีที่แล้ว

    Brad how about doing a series with pure nodejs without any framework it's more powerful and no dependence especially for developers who only needs routing I also have to point out using express and other frameworks slows node down by half in most cases trust me it's better to use node as it was intended that's currently my observation and please don't use mongoose these devs should learn how to use the native Mongo driver. That's the issue with javascript too many framework and too many packages most devs won't learn shit I had to learn the hard way.

    • @lardosian
      @lardosian 6 ปีที่แล้ว

      Im guessing you would recommend the node js masterclass course that teachs pure node, no frameworks, pops up in my adds a lot.

  • @mikevaleriano9557
    @mikevaleriano9557 6 ปีที่แล้ว

    I miss mlab already. So much easier to mess around than that damn cloud @ mongodb. =/

  • @michaels2713
    @michaels2713 6 ปีที่แล้ว

    Mongoose supports timestamps out of the box now, just notice

  • @mycollegeshirt
    @mycollegeshirt 5 ปีที่แล้ว

    I always use port 9001, because yknow

  • @Mostaqmahmud
    @Mostaqmahmud 6 ปีที่แล้ว

    Love you man... Nothing to say

  • @logicawe
    @logicawe 6 ปีที่แล้ว

    Amazing video!

  • @DerekAGilbert
    @DerekAGilbert 6 ปีที่แล้ว

    I would pay $100 dollar for an in-depth course on Koa. Hook us up brad!

  • @jamiusamin
    @jamiusamin 6 ปีที่แล้ว

    Brad the Man

  • @gioelegentile
    @gioelegentile 6 ปีที่แล้ว

    Really useful, but this is not really RESTful by the way

    • @TraversyMedia
      @TraversyMedia  6 ปีที่แล้ว

      Can you explain what you mean? It follows the REST architecture. I know definitions can be a little different for different people. I am curious to what you mean though

    • @gioelegentile
      @gioelegentile 6 ปีที่แล้ว

      @@TraversyMedia I'm sorry, I should've said "to me".
      I use to add URIs to responses objects, because resources are identified by those and the client should not construct/guess the URIs by itself. Also, with POST/PUT/PATCH I always return the object created/updated in the response body, so It's much easier to consume these methods in asynchronous web apps.
      What do you think?

  • @nadir2k
    @nadir2k 6 ปีที่แล้ว

    I'm Going to ''module.exports" KUDOS

  • @wilfredomendez3450
    @wilfredomendez3450 5 ปีที่แล้ว

    Awesome thanks.

  • @chees720
    @chees720 6 ปีที่แล้ว

    Thanks man

  • @markcuello5
    @markcuello5 2 ปีที่แล้ว

    HELP

  • @muhammadnasir9515
    @muhammadnasir9515 6 ปีที่แล้ว

    Great

  • @kornettgutten
    @kornettgutten 6 ปีที่แล้ว

    Could you make a tutorial on a PHP REST API with oauth2 or token auth?

  • @gopinathkrm58
    @gopinathkrm58 6 ปีที่แล้ว

    Angular 7 please Brad

  • @FancyLillyChaan
    @FancyLillyChaan 6 ปีที่แล้ว

  • @redbeardjunior
    @redbeardjunior 6 ปีที่แล้ว

    First