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!
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).
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.
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
@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?
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.
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 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 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!
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!
Glad you're making videos again. I enjoy your content!
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).
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.
@@TheNerdyCanuck thanks for that!
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
i love it, i'm from thailand I'm just starting to learn how to program. I really enjoy your videos.
Thank you Sir that was exactly what I was looking for.
Simple and educative!
This way better than a Netflix series
Appreciate that
I hope you will cover Jest as well. I tried it before but I got trouble with type-checking inside test files.
I am working on some test stuff now
Thanks a lot for providing such a quality content
Best practices. !!!
@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?
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.
@@igorserrao5745 thanks it's worked! And also you can solute that with export const corsHandler = async (params): Promise => {/*code*/}
i did everything as shown but my server starts on the backup port 12345, not 1337 why is that
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?
No overload matches makes me assume the function itself isn't defined properly. Still having this issue?
@@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;
@@pdsavard strange, it should let you return but I'm happy you got it to work!
@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!
Its a setting in the config file to check the NODE_ENV env var
why using package cors. Thanks
You can use a package for it for sure, it's probably easier
Great video 👍
Why are you not making more videos?
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 :)
@@TheNerdyCanuck Cool. Plz make more vidoes on NodeJS Angular GraphQL
Why can logging be used in handlelogging middleware?
The middleware is designed to add logging to every request instead of using a third party library.
@@TheNerdyCanuck thanks