New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

node-feign

Package Overview
Dependencies
Maintainers
2
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-feign

node-feign用于远程调用http服务的客户端工具,支持调用nacos中注册的远程http服务。

latest
npmnpm
Version
1.5.0
Version published
Maintainers
2
Created
Source

简介

node-feign用于远程调用http服务的客户端工具,支持调用nacos中注册的远程http服务。

安装

yarn add node-feign

使用

// user.module.ts
import { Module } from "@nestjs/common";
import { FeignModule } from "./feign.module";
import { UserController } from "./user.controller";

@Module({
  imports: [
    FeignModule.forRoot({
      namespace: "xxx",
      serverList: "xxx"
    }, {
      timeout: 3000
    })
  ],
  controllers: [UserController]
})
export class UserModule {

}


// user.service.ts
@Controller("users")
export class UserController {
  constructor(private readonly feign: FeignService) {
  }

  @Get()
 async getList(){
   const options = {
      name: "node-map",
      method: "GET",
      url:"/list"
   };
   return this.feign.do(options);
  }
}

Keywords

feign

FAQs

Package last updated on 27 Jun 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts