JavaScript

The following section covers the components of JavaScript frameworks and their library components that NightVision’s API Discovery capability can detect and use to generate OpenAPI documentation. If a component that you use is not supported, please get in touch with our support team at [email protected], and we can add this as a new feature.

JavaScript

@nestjs/common

Library ComponentDescription
ControllerDecorator to define a controller class in NestJS, which handles incoming HTTP requests.
ModuleDecorator to define a module in NestJS, used to organize related components, services, and controllers.
InjectableDecorator to define a class as a provider that can be injected into other components via dependency injection.

@nestjs/core

Library ComponentDescription
DynamicModuleRepresents a dynamically created module in NestJS.
NestFactory.createMethod to create an application instance using the NestFactory class.
@nestjs/core.RouteRepresents a route definition in NestJS, used for setting up routing at the core level.
@nestjs/core.RouterModule.registerMethod to register a set of routes in NestJS.
@nestjs/core.nestjs_app.setGlobalPrefixMethod to set a global prefix for all routes in a NestJS application.
@nestjs/core.nestjs_app.listenMethod to start listening for incoming HTTP requests in a NestJS application.

Express

Library ComponentDescription
express.RouterMethod to create a new router object to handle routes in Express.
express()Method to initialize a new Express application instance.
app.getMethod to handle HTTP GET requests in an Express application.
app.postMethod to handle HTTP POST requests in an Express application.
app.putMethod to handle HTTP PUT requests in an Express application.
app.patchMethod to handle HTTP PATCH requests in an Express application.
app.deleteMethod to handle HTTP DELETE requests in an Express application.
app.allMethod to handle all HTTP methods in an Express application.
app.useMethod to mount middleware or sub-applications.
app.routerThe application’s in-built instance of router. This is created lazily, on first access.
app.listenMethod to start listening for HTTP requests on a specified port.
app.routeMethod to create a route with a specific path in an Express application.
request.paramsRepresents the parameters sent in the request URL in an Express application.
request.bodyRepresents the parameters sent in the request body in an Express application.
request.queryRepresents the parameters sent in the request query in an Express application.

Fastify

Library ComponentDescription
@fastify.autoloadFastify plugin that loads and configure routes matching the folder structure.
fastify.getMethod to handle HTTP GET requests in a Fastify application.
fastify.headMethod to handle HTTP HEAD requests in a Fastify application.
fastify.postMethod to handle HTTP POST requests in a Fastify application.
fastify.putMethod to handle HTTP PUT requests in a Fastify application.
fastify.deleteMethod to handle HTTP DELETE requests in a Fastify application.
fastify.optionsMethod to handle HTTP OPTIONS requests in a Fastify application.
fastify.patchMethod to handle HTTP PATCH requests in a Fastify application.
fastify.routeMethod to configure the endpoints in a Fastify application.
fastify.registerMethod to configure specific behaviors for a route, e.g. to add prefixes or log levels.
fastify.afterMethod that is executed once the previous declared register has finished.
fastify.readyMethod that is executed once all the registers declared have finished their execution.
fastify.listenBehaves the same way as ready, starting the server for a given port.