@opra/nestjs-http
v1.29.0
Published
Opra NestJS Http Module
Readme
@opra/nestjs-http
NestJS HTTP module for the OPRA framework
🌐 Documentation · 🚀 Getting Started · 📦 Packages · 💬 Issues
NestJS HTTP module for the OPRA framework. Register your OPRA API inside a NestJS application in a few lines.
Features
OpraHttpModule— Dynamically configurable NestJS module (forRoot/forRootAsync)OpraHttpNestjsAdapter— NestJS adapter integrating OPRA's HTTP handlerOpraExceptionFilter— Global exception filter that maps OPRA errors to HTTP responsesOpraMiddleware— Request/response middleware for the OPRA pipeline- Full support for NestJS dependency injection, interceptors, and guards
Installation
npm install @opra/nestjs-httpUsage
import { Module } from '@nestjs/common';
import { OpraHttpModule } from '@opra/nestjs-http';
@Module({
imports: [
OpraHttpModule.forRoot({
name: 'MyAPI',
basePath: 'v1',
schemaIsPublic: true,
controllers: [UsersController, ProductsController],
providers: [UsersService, ProductsService],
types: [User, Product],
}),
],
})
export class AppModule {}Async configuration
OpraHttpModule.forRootAsync({
useFactory: (config: ConfigService) => ({
name: config.get('API_NAME'),
controllers: [UsersController],
}),
inject: [ConfigService],
});Node Compatibility
- node >= 20.x
License
Available under MIT license.
