Package Exports
- nest-jsonapi
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (nest-jsonapi) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
A Nest module that provides JSONAPI integration.
Installation
npm install --save nest-jsonapiReference Example
nestjs-jsonapi-example is an example project that demonstrates the usage of this module. Since not all aspects of the module have been fully tested yet (coming soon!), I highly suggest checking this out!
Quick Start
Import the JsonapiModule into the root AppModule and use the forRoot() method to configure it:
import { Module } from "@nestjs/common";
import { JsonapiModule } from "nest-jsonapi";
@Module({
imports: [
JsonapiModule.forRoot({
// options
}),
],
})
export class AppModule {}Afterward, the JsonapiService instance will be available to inject across entire project using the service token JSONAPI_MODULE_SERVICE:
import { Controller, Inject } from "@nestjs/common";
import { JsonapiService, JSONAPI_MODULE_SERVICE } from "nest-jsonapi";
@Controller("photos")
export class PhotosController {
constructor(@Inject(JSONAPI_MODULE_SERVICE) private readonly jsonapiService: JsonapiService) {}
}Note that JsonapiModule is a global module, therefore it will be available in all modules.
Contributing
See the Contributing guide for details.
License
This project is licensed under the MIT License.