@eqxjs/ambassador
TypeScript icon, indicating that this package has built-in type declarations

0.0.2 • Public • Published

Equinox 2 Ambassador

Ambassador is a Javascript library for nestjs.

Installation

Use the node package manager npm to install Ambassador.

npm install @eqxjs/ambassador

HTTP Usage

import { Module } from '@nestjs/common';
import { AppController } from './app.controller';
import { AppService } from './app.service';
import {HttpModule} from '@eqxjs/ambassador'

@Module({
  imports: [
    HttpModule.register({
      timeout: 5000,
      maxRedirects: 5,
    }),
  ],
  controllers: [AppController],
  providers: [
    AppService,
  ],
})
export class AppModule {}
import { Injectable } from '@nestjs/common';
import {HttpService} from '@eqxjs/ambassador'
import {firstValueFrom} from 'rxjs'

@Injectable()
export class AppService {
  constructor(private readonly httpService: HttpService){}
  async getHello(): Promise<string> {
    const observ = this.httpService.get<string>('http://localhost:3000/data');
    const {data} = await firstValueFrom(observ);
    return data;
  }
}

Mongo Usage

GraphQL Usage

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

License

MIT

Package Sidebar

Install

npm i @eqxjs/ambassador

Weekly Downloads

4

Version

0.0.2

License

MIT

Unpacked Size

14.3 kB

Total Files

20

Last publish

Collaborators

  • khunbankz
  • xyzxyz442
  • heraosw
  • aretit2533
  • eqxjs-org