@appvise/nestjs-module-config-provider
v0.0.3
Published
Provide a core manifest for describing your service using registered interfaces.
Downloads
3
Readme
@appvise/nestjs-module-config-provider
Provide a core manifest for describing your service using registered interfaces.
Usage
Importing the module will generate a /manifest.json
route in your application:
import { ConfigProviderModule } from '@appvise/nestjs-module-config-provider';
// Include the main controller in your application
@Module({
imports: [
ConfigProviderModule,
],
})
export class AppModule {}
Now that you have a core manifest, you can use the provided decorators to include components in your manifest as follows:
import { ConfigApi } from '@appvise/nestjs-module-config-provider';
@Controller()
export class AppController {
@Get()
getHello(): string {
return 'Hello Controller';
}
@ConfigSsoApi({
protocol : 'graphql',
path : '/graphql',
})
@Get('graphql')
async getGraphQL(@Request() req, @Response() res): Promise<void> {
// Handle graphql request here
}
}
Registered components
As this module generates a manifest for your registered components, here is a list of registered components:
- api: Defines an api being present. This component must contain the
protocol
and (path
orurl
) keys. - sso-web: Defines an sso login method which the client must open a browser
for to use. Must contain the (
path
orurl
),provider
andresult
keys.
API
TODO: describe api options, ConfigApi decorator, etc.
SSO-WEB
TODO: describe sso-web options, ConfigSsoWeb decorator, etc