Install NearIndexerComponent using npm
;
$ [npm install | yarn add] @collabland/near-indexer
Configure and load NearIndexerComponent in the application constructor as shown below.
import {NearIndexerComponent, NearIndexerComponentOptions, DEFAULT_COLLABLAND_NEAR_INDEXER_OPTIONS} from '@collabland/near-indexer';
// ...
export class MyApplication extends BootMixin(ServiceMixin(RepositoryMixin(RestApplication))) {
constructor(options: ApplicationConfig = {}) {
const opts: NearIndexerComponentOptions = DEFAULT_COLLABLAND_NEAR_INDEXER_OPTIONS;
this.configure(NearIndexerComponentBindings.COMPONENT).to(opts);
// Put the configuration options here
});
this.component(NearIndexerComponent);
// ...
}
// ...
}