[Documentation] Express Typing
See original GitHub issueIt’s really good to see a web framework that deals with TypeScript as a first class citizen! I’m really excited about this project because of this.
However, when turning the option: noImplicitAny
in the tsconfig.json
the compiler will produce warnings about a lot of the examples in the documentation.
I highly recommend adding Express TypeScript declarations to the examples like so:
import {Request,Response,NextFunction} from "@types/express";
@Controller({})
export class UsersController {
getAllUsers(req:Request, res:Response, next:NextFunction) {
// will have auto completion, type safety ...etc
}
}
Issue Analytics
- State:
- Created 6 years ago
- Reactions:8
- Comments:13 (3 by maintainers)
Top Results From Across the Web
5.x API - Express.js
Returns middleware that only parses JSON and only looks at requests where the Content-Type header matches the type option. This parser accepts any...
Read more >@types/express - npm
This package contains type definitions for Express (http://expressjs.com). Details. Files were exported from https://github.com/DefinitelyTyped/ ...
Read more >Documenting your Express API with Swagger - LogRocket Blog
This tutorial shows you how to maintain thorough API documentation by using Swagger with an Express API in Node.
Read more >Express/Node introduction - Learn web development | MDN
Go back to the terminal and type the following command: ... The following example (from the Express documentation) shows a handler that will ......
Read more >Typed express with generated swagger docs
Typed Express swagger-docs TLDR: I was missing some simple and minimalist... Tagged with typescript, backend, express, swagger.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Then the server package would still need to have both Fastify and Nest platform installed for it to work, and Nest still supports JS, so that’s not an option either, plus it’s more a downgrade than an actual bug fix imo. My advice? Stop being lazy.
@ThomRick He’s asking that the examples on https://kamilmysliwiec.gitbooks.io/nest/content/ add the Express types. Right now they just say:
as opposed to