Typescript API in NodeJS / Express in Depth [Part 1]

แชร์
ฝัง
  • เผยแพร่เมื่อ 1 ม.ค. 2025

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

  • @rayrobinsongonzaga9681
    @rayrobinsongonzaga9681 4 หลายเดือนก่อน +3

    The perfect tutorial I've been looking for! Not just teaching the technologies but most especially best practices, testing, and error handling! Thank you! Make more videos please! Subscribed!

  • @mallorylaforet6419
    @mallorylaforet6419 10 หลายเดือนก่อน +1

    Glad you're making videos again. I enjoy your content!

  • @AndrewEddie
    @AndrewEddie 10 หลายเดือนก่อน +3

    Great update. I shot you a pull request that shows you how to use the Rest Client plugin available in VSCode as an alternative to Postman.
    Also happy to do an example for project based snippets if you are interested (you could, as a silly example, set up a snippet to give you boiler-plate code for any middleware function).

    • @TheNerdyCanuck
      @TheNerdyCanuck  10 หลายเดือนก่อน +1

      I like that a lot! Looks really easy to define some routing tests (instead of postman)
      I think I'll merge it in for people to try.
      As for snippets, I'm saving those for other videos as things get more complex.

    • @AndrewEddie
      @AndrewEddie 10 หลายเดือนก่อน

      @@TheNerdyCanuck thanks for that!

  • @TheOnlyIchiban
    @TheOnlyIchiban 3 หลายเดือนก่อน

    This is seriously a fantastic tutorial, i love the in depth explanations on what you're doing and the reasons, it's really important to understand. This was exactly what I needed, awesome work

  • @beetpalm
    @beetpalm 5 หลายเดือนก่อน +1

    i love it, i'm from thailand I'm just starting to learn how to program. I really enjoy your videos.

  • @JacquesOP
    @JacquesOP 6 หลายเดือนก่อน +1

    Thank you Sir that was exactly what I was looking for.
    Simple and educative!

  • @SayfSentinel
    @SayfSentinel 3 หลายเดือนก่อน +1

    This way better than a Netflix series

  • @lukaslearning3549
    @lukaslearning3549 7 หลายเดือนก่อน +1

    I hope you will cover Jest as well. I tried it before but I got trouble with type-checking inside test files.

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

      I am working on some test stuff now

  • @csguru8211
    @csguru8211 7 หลายเดือนก่อน +1

    Thanks a lot for providing such a quality content

  • @morkhoudia9
    @morkhoudia9 หลายเดือนก่อน +1

    Best practices. !!!

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

    @18:47 application.use(corsHandler);
    No overload matches this call.
    The last overload gave the following error.
    Argument of type '(req: Request, res: Response, next: NextFunction) => Response | undefined' is not assignable to parameter of type 'PathParams'.ts(2769)
    What does this error mean? Can you recommend a fix?

    • @igorserrao5745
      @igorserrao5745 26 วันที่ผ่านมา

      Currently, the TypeScript version no longer requires creating a "return.res". Using "res.setHeader('Access-Control-Allow-Origin...')" is already sufficient and doesn't cause React to throw an error.

    • @yasinbozkurt33
      @yasinbozkurt33 21 วันที่ผ่านมา

      @@igorserrao5745 thanks it's worked! And also you can solute that with export const corsHandler = async (params): Promise => {/*code*/}

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

    i did everything as shown but my server starts on the backup port 12345, not 1337 why is that

  • @pdsavard
    @pdsavard 3 หลายเดือนก่อน +1

    Thanks for the great video. Got a small question, in the Cors Middleware, I can't add the return res.status(200).json({}) without getting a typescript error on the application.use(corsMiddleware). error: No Overload matches this call... Any idea?

    • @TheNerdyCanuck
      @TheNerdyCanuck  2 หลายเดือนก่อน

      No overload matches makes me assume the function itself isn't defined properly. Still having this issue?

    • @pdsavard
      @pdsavard 2 หลายเดือนก่อน

      @@TheNerdyCanuck solved! its because in typescript I can't do return res.status(200)...... something do not like that. I need to set the status then do a "empty" return;

    • @TheNerdyCanuck
      @TheNerdyCanuck  2 หลายเดือนก่อน

      @@pdsavard strange, it should let you return but I'm happy you got it to work!

  • @aliahmadi8816
    @aliahmadi8816 5 หลายเดือนก่อน +1

    @TheNerdyCanuck Thank you for the content, I get an error if i try to log any of the config variables, I have to import them individually for it to work, what i mean is doing:
    import './config/config';
    console.log(DEVELOPMENT)
    will throw an error that
    Cannot find name 'DEVELOPMENT
    Thank you!

    • @TheNerdyCanuck
      @TheNerdyCanuck  5 หลายเดือนก่อน

      Its a setting in the config file to check the NODE_ENV env var

  • @trieunguyentuan4589
    @trieunguyentuan4589 9 หลายเดือนก่อน +2

    why using package cors. Thanks

    • @TheNerdyCanuck
      @TheNerdyCanuck  9 หลายเดือนก่อน +1

      You can use a package for it for sure, it's probably easier

  • @daz1uk
    @daz1uk 7 หลายเดือนก่อน +1

    Great video 👍

  • @attaullahsiddiqui3931
    @attaullahsiddiqui3931 5 หลายเดือนก่อน

    Why are you not making more videos?

    • @TheNerdyCanuck
      @TheNerdyCanuck  5 หลายเดือนก่อน +1

      I would like to make more! I am working on some testing ones right now, it's just hard to justify the time with the kids atm :)

    • @attaullahsiddiqui3931
      @attaullahsiddiqui3931 5 หลายเดือนก่อน

      @@TheNerdyCanuck Cool. Plz make more vidoes on NodeJS Angular GraphQL

  • @atnguyen-qg6ze
    @atnguyen-qg6ze 4 หลายเดือนก่อน

    Why can logging be used in handlelogging middleware?

    • @TheNerdyCanuck
      @TheNerdyCanuck  4 หลายเดือนก่อน +1

      The middleware is designed to add logging to every request instead of using a third party library.

    • @atnguyen-qg6ze
      @atnguyen-qg6ze 4 หลายเดือนก่อน

      @@TheNerdyCanuck thanks