Your clear explanations, detailed examples, and thorough coverage made it a breeze to follow along and understand. I truly appreciate the effort you put into creating such valuable content. Looking forward to more tutorials from you in the future! Keep up the fantastic work!
Man, I really appreciate the work you're doing! The content you're creating is incredible, especially with how you dive into the finer details. Like, there's no good video on UA-cam covering annotations and TypeScript setup with Express, and you explain even the smallest things-like when to use `npx` and when not to. Honestly, you're an amazing teacher, and man you own my respect. Bruh, this is some solid intermediate-level content! We definitely need more videos like this. They really help us get a better idea of writing clean code. Thanks again for all the effort you put into these!
Next tutorial can be a complete monorepo (like turborepo) with this stack, bonus add dockerization and deployment as well. Thanks for the amazing content.
I was stuck in a bug where ts-node wont run and say couldn't recognize the file type '.ts' then I found out I was using type: moule in the package.json file which was causing the issue. I then removed it and it worked fine. I don't know there's an open issue in the ts-node repo about not working with module type!
i got my server down when i declare the index.d.ts for extend request interface , the controller file did not show erro and ts knows the property but server goes down Property 'CustomField' does nto type 'Request
There's something about the way that the Request interface is extended globally that nodemon doesn't like. You can work around it using "start:dev": "nodemon --exec 'tsc && node dist/index.js' --ext ts" in your package.json
hello. Thank you for the great lecture. I have one question. If I write return before res.status in the handler, an error occurs in the router. Can you tell me why?
Great work sir. THis helped me to use typescript with express seamlessly. Please, I would want to know what font you are using on this vscode. It is really nice. I want to use it too.
almost every coures I find on youtube use any, only you explain what going in generic 40:17 ,thank . Is there any cheatsheat TypeScript for express,I can only cheatsheat for reactjs,it kinda suck
When you're a beginner, it's fine to refer to UA-cam videos or courses on platforms like Udemy. When you become more advanced, you learn how to refer to documentation and build intuition with your experience.
Very clear, thank you. You’ve now got my toes wet with typescript. 1 question, how come when you ran npm run test:e2e it only ran 1 test for you, but for me it’s running both the e2e test, and the handler test?
My guess would be you may have forgot to set the flag for the test:e2e script to run tests only in the src/e2e folder. By default it will run all .test.ts or .spec.ts test files.
How come you didn’t get an error when you name your user.ts router a const route then call it in index.ts as import userRouter. Im confuse. Please explain it to me
can you make a tutorial how to setup both nextjs + expressjs with typescript sir? like nextjs for frontend and expressjs with typescript for backend just a simple to-do or any
Hi @Anson. Express does not let me overload response parameter with my own type. When setting my own interface as returned type, and trying to return it, im getting error that : The last overload gave the following error. Argument of type '(req: Request, res: Response) => Promise' is not assignable to parameter of type 'Application'. Even chatGPT could not solve it ;) Maybe u can outsmart it?
Hey anson, i was keeping up with your tutorials and they are very helpfull, i was wondering if you could make a class in nodejs rest api architecture?, like controller services and such, couldnt find any good tutorials online, mostly artricles with weak examples
By that point you’re better off just using Nestjs, which was designed with this architecture in mind. Which I also have plenty of videos on my channel.
I am sorry to ask you this. but I am new to Express with TypeScript. i worked with django. But for expanding my tech stack i am learning to express the best way. One thing i loved in django(Django-ninja) was automatic API documentation. is there any way to achieve similar functionality in Express? I did search API documentation with Express but all I find is manual documentation. If there is any way to automatically generate documentation with Joi or TS interface it would be really helpful. BTW love the video. it got me started TS with Express
Typically, you won't directly import or interact with express-serve-static-core. It is used internally by Express. However, if you are writing TypeScript or creating TypeScript types for your Express application, you might import types from express-serve-static-core, as it contains TypeScript definitions for core Express objects.
This is an amazing tutorial. I would like to seek your recommendation; based on what you showed in tutorial most in the part of e2e test what is your point of view in using `App` type from supertest/types instead of assigning variable app to `Express` type. ua-cam.com/video/Be7X6QJusJA/v-deo.html
I used "Express" because that's the inferred type from the express() function call that is returned. Never knew there was an App type. But I never had any issues using the Express type.
Your clear explanations, detailed examples, and thorough coverage made it a breeze to follow along and understand. I truly appreciate the effort you put into creating such valuable content. Looking forward to more tutorials from you in the future! Keep up the fantastic work!
Thanks a lot! I do try my best when making vids like these, so to hear stuff like this is very much appreciated. :)
I have been waiting for this tutorial. Here we are. Thank you very much.
Man, I really appreciate the work you're doing! The content you're creating is incredible, especially with how you dive into the finer details. Like, there's no good video on UA-cam covering annotations and TypeScript setup with Express, and you explain even the smallest things-like when to use `npx` and when not to. Honestly, you're an amazing teacher, and man you own my respect.
Bruh, this is some solid intermediate-level content! We definitely need more videos like this. They really help us get a better idea of writing clean code. Thanks again for all the effort you put into these!
Next tutorial can be a complete monorepo (like turborepo) with this stack, bonus add dockerization and deployment as well. Thanks for the amazing content.
Wabhhh this channel is gold man, why i never see till now man
Do we need to include dist folder to .gitignore?
for this typescipt with express first I visited your channel ☺....thanks a lot brother
So incredibly helpful! Thank you a lot!
Thank you so much Anson for this I am currently diving into testing and this is just perfect to help me get started. Thank you!!!
Glad to hear that. You're welcome. :D
Thank you very much for this video! I was a bit lost trying to set up TypeScript properly.
Helped a lot. Thanks. Subscribed!
I was stuck in a bug where ts-node wont run and say couldn't recognize the file type '.ts' then I found out I was using type: moule in the package.json file which was causing the issue. I then removed it and it worked fine. I don't know there's an open issue in the ts-node repo about not working with module type!
This is very informative, thank you very much for the tutorial❤
53:51 if your index.d.ts fiile is not executing make sure to include it in the tsconfig.json else you will not get the custom field
Hey Anson.. Really useful one.. Thanks a lot for creating such beautiful content...
Explained clearly ; well done 👍
U r best, hello from Kyrgyzstan, really appreciate ur videos 👍
Thank you :)
Thank you very much!
1:14:55
import express from 'express';
let app: ReturnType;
should work as well.
Great tutorial. Helped me a lot, thanks man 👍
i got my server down when i declare the index.d.ts for extend request interface , the controller file did not show erro and ts knows the property but server goes down Property 'CustomField' does nto type 'Request
There's something about the way that the Request interface is extended globally that nodemon doesn't like. You can work around it using
"start:dev": "nodemon --exec 'tsc && node dist/index.js' --ext ts"
in your package.json
I have the same problem...
Great job, Anson
When are you going to upload an advance ExpressJs tutorial?
Thanks for this awesome tutorial 💚
It's in the works. Thank you!
Hello, thanks for the video. It's amazing. Can you please let me know what font and which theme did you use in this video?
what theme is that, that's a pretty bold theme
hello. Thank you for the great lecture.
I have one question. If I write return before res.status in the handler, an error occurs in the router. Can you tell me why?
Good job 👍👏
Thanks! :D
Great man, what extension are you using for intelligence.
This is amazing thank you so much.
Super helpful, thank you!
awesome tutorial. Thanks for the video
You're welcome. Thanks! :D
With the latest version of nodemon you don't need a separate install of ts-node. Nodemon will do the same thing for you.
Legend!
Thank you so much for sharing
amazing video. thanks a lot!
Great work sir. THis helped me to use typescript with express seamlessly. Please, I would want to know what font you are using on this vscode. It is really nice. I want to use it too.
Which theme are you using?
1:05:46 how to differentiate one request to others?
Awesome one Thank you so much
You are welcome!
almost every coures I find on youtube use any, only you explain what going in generic 40:17 ,thank .
Is there any cheatsheat TypeScript for express,I can only cheatsheat for reactjs,it kinda suck
i'm getting unknown file extension with ts-node ,my type is set to "type" : "module
//tsconfig.json
{
"compilerOptions": {
"target": "es2016",
"module": "commonjs",
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"strict": true,
"skipLibCheck": true
}
}
//package.json
{
"name": "backend",
"version": "1.0.0",
"main": "index.js",
"scripts": {
"build": "tsc",
"start": "node ./dist/index.js",
"dev" : "nodemon ./src/index.ts"
},
"author": "Ahmad Hassan Khan",
"license": "ISC",
"description": "",
"devDependencies": {
"@types/cors": "^2.8.17",
"@types/express": "^4.17.21",
"@types/node": "^22.5.4",
"express": "^4.19.2",
"nodemon": "^3.1.4",
"ts-node": "^10.9.2",
"typescript": "^5.5.4"
},
"dependencies": {
"cors": "^2.8.5",
"jsonwebtoken": "^9.0.2"
}
}
yoo I got the same case, were you able to resolve this?
Hey Anson, love your videos. Would you consider making a tutorial for fastify ?
Please your vs code extension ?
Thanks for rich content .
I just want to ask how you learn these concept like nestjs and other along with best practices any sources?
When you're a beginner, it's fine to refer to UA-cam videos or courses on platforms like Udemy. When you become more advanced, you learn how to refer to documentation and build intuition with your experience.
Awesome tutorial!
Very clear, thank you. You’ve now got my toes wet with typescript. 1 question, how come when you ran npm run test:e2e it only ran 1 test for you, but for me it’s running both the e2e test, and the handler test?
My guess would be you may have forgot to set the flag for the test:e2e script to run tests only in the src/e2e folder. By default it will run all .test.ts or .spec.ts test files.
Thanks Anson.
How come you didn’t get an error when you name your user.ts router a const route then call it in index.ts as import userRouter. Im confuse. Please explain it to me
Thank you so much ..
You’re welcome
Wow!
can you make a tutorial how to setup both nextjs + expressjs with typescript sir? like nextjs for frontend and expressjs with typescript for backend just a simple to-do or any
Wow, interesting 🎉
Hi @Anson. Express does not let me overload response parameter with my own type. When setting my own interface as returned type, and trying to return it, im getting error that :
The last overload gave the following error.
Argument of type '(req: Request, res: Response) => Promise' is not assignable to parameter of type 'Application'.
Even chatGPT could not solve it ;) Maybe u can outsmart it?
Hey anson, i was keeping up with your tutorials and they are very helpfull, i was wondering if you could make a class in nodejs rest api architecture?, like controller services and such, couldnt find any good tutorials online, mostly artricles with weak examples
By that point you’re better off just using Nestjs, which was designed with this architecture in mind. Which I also have plenty of videos on my channel.
Bro using Javascript classes in 2024
@@govindamishra3746 and there’s absolutely nothing wrong with that.
greate content keep up the good work
I hope you will make a live stream again with a program that is stronger than chat🌺
What font are you using there?
I am also curious about the font
Hey can we have a video on an opionated one :adonis js??
I believe it doesnt make much sense since here they explain the whole typescript + express setup and adonisjs is already typescript ready.
I am sorry to ask you this. but I am new to Express with TypeScript. i worked with django. But for expanding my tech stack i am learning to express the best way. One thing i loved in django(Django-ninja) was automatic API documentation. is there any way to achieve similar functionality in Express? I did search API documentation with Express but all I find is manual documentation. If there is any way to automatically generate documentation with Joi or TS interface it would be really helpful.
BTW love the video. it got me started TS with Express
There is Swagger, not sure about it being automatic, but it does provide documenting your APIs for you.
I don't understand when to use express-serve-static-core v/s express
Typically, you won't directly import or interact with express-serve-static-core. It is used internally by Express. However, if you are writing TypeScript or creating TypeScript types for your Express application, you might import types from express-serve-static-core, as it contains TypeScript definitions for core Express objects.
if you're not doing any low-level Express manipulation or using TypeScript, you can ignore express-serve-static-core and focus on using express
Bro can you please make a video on typescript with react, and react query humble request 😢🙏
I have a video on react query already that will be uploaded soon.
This is an amazing tutorial.
I would like to seek your recommendation; based on what you showed in tutorial most in the part of e2e test what is your point of view in using `App` type from supertest/types instead of assigning variable app to `Express` type. ua-cam.com/video/Be7X6QJusJA/v-deo.html
I used "Express" because that's the inferred type from the express() function call that is returned. Never knew there was an App type. But I never had any issues using the Express type.
bro, what font are u using?