forked from lthn/blockchain
This pull request introduces a comprehensive new API interface for the blockchain, leveraging OpenAPI v3 to facilitate direct consumption of chain data by GUI and web applications. This change significantly refines the project's build infrastructure, incorporating Conan for dependency management and CMake for configuration, alongside the integration of an OpenAPI Generator to produce SDKs for multiple languages. ### Highlights * **New API Interface**: Introduced a new API interface using OpenAPI v3 to enable GUI/WEB development to consume chain data without needing custom server applications. * **Build System Enhancements**: Significant updates to the build system, including Makefile, CMake, and Conan configurations, to streamline the build process and support new functionalities. * **Multi-language SDK Generation**: Integrated OpenAPI Generator to automatically create SDKs for various programming languages, including Go, Angular, and PHP, simplifying client-side integration.
30 lines
1 KiB
TypeScript
Generated
30 lines
1 KiB
TypeScript
Generated
import { NgModule, ModuleWithProviders, SkipSelf, Optional } from '@angular/core';
|
|
import { lthnConfiguration } from './configuration';
|
|
import { HttpClient } from '@angular/common/http';
|
|
|
|
|
|
@NgModule({
|
|
imports: [],
|
|
declarations: [],
|
|
exports: [],
|
|
providers: []
|
|
})
|
|
export class lthnApiModule {
|
|
public static forRoot(configurationFactory: () => lthnConfiguration): ModuleWithProviders<lthnApiModule> {
|
|
return {
|
|
ngModule: lthnApiModule,
|
|
providers: [ { provide: lthnConfiguration, useFactory: configurationFactory } ]
|
|
};
|
|
}
|
|
|
|
constructor( @Optional() @SkipSelf() parentModule: lthnApiModule,
|
|
@Optional() http: HttpClient) {
|
|
if (parentModule) {
|
|
throw new Error('lthnApiModule is already loaded. Import in your base AppModule only.');
|
|
}
|
|
if (!http) {
|
|
throw new Error('You need to import the HttpClientModule in your AppModule! \n' +
|
|
'See also https://github.com/angular/angular/issues/20575');
|
|
}
|
|
}
|
|
}
|