Typescript API with a Generic Mongo / Mongoose Controller

แชร์
ฝัง
  • เผยแพร่เมื่อ 18 ต.ค. 2024
  • Here is a little trick I use when creating projects with 5 or more controllers. It just makes life so much easier!
    Video Info
    Music by Tesko / prod. THXMOS: / @prod.thxmos6970
    Github starter project: github.com/joe...
    Support
    Like this video? You can show your support by buying me a coffee ☕❤️: www.buymeacoff...
    Socials
    Github: github.com/joe...
    Twitter: / thenerdycanuck
    About The Channel
    The knowledge that I share here is mostly from my personal experiences. I wouldn't say I'm a 20 year professional, rather I am just a DevOps / Software Engineer with a lot of experience who enjoys teaching what I know in my spare time. I believe that sharing some of my basic knowledge on this platform can help others get started. There are many ways to program something and the videos you see here are my take on the NodeJS / Typescript / and sometimes Unity world. If this channel helps you learn, or helps you think differently then my job is done 😊.
    #reactjs #socketio #typescript

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

  • @piotrszymanski8325
    @piotrszymanski8325 2 ปีที่แล้ว +1

    M8, love yours vids. You touch topics, different then others, so usefull. I wish you 1mln subs! Keep on going!

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

    Awesome logic!, thanks for video

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

    Awesome work! How do we pass different models in dynamic routing?

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

      Good question! I think the repository has the example, if you can't figure it out let me know.

  • @johnnydriesen7575
    @johnnydriesen7575 2 ปีที่แล้ว +1

    Great solution.
    Thanks for sharing your knowledge, & creating this vid.
    Wondering how we can populate records (like... getting an author by ID, including all his books.
    Can't wait to see dynamic routing...

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

      pass in an array as a second arguement to your model, as an example in the get function, and pass in array of strings you want to populate: ['author']

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

    Very good! One suggestion, instead of these any types, why not make the create function accept a generic type, and then pass it to the argument and response?!?

    • @TheNerdyCanuck
      @TheNerdyCanuck  2 ปีที่แล้ว +1

      You totally can, I just made this one quick and dirty to keep it under 15 minutes