# aliyun-api-gateway

> Aliyun API Gateway Node.js SDK

Latest version **1.1.6** (published 2018-12-14) · MIT license · 0 weekly downloads

## Install

```sh
npm install aliyun-api-gateway
pnpm add aliyun-api-gateway
yarn add aliyun-api-gateway
bun add aliyun-api-gateway
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.6 |
| Published | 2018-12-14 |
| First published | 2016-12-15 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 4 |
| Unpacked size | 35.5 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| Author | Jackson Tian |
| Maintainers | jacksontian |

## Links

- npm: https://www.npmjs.com/package/aliyun-api-gateway
- npm.io page: https://npm.io/package/aliyun-api-gateway

## Dependencies (4)

- [uuid](https://npm.io/package/uuid.md) ^3.0.0
- [debug](https://npm.io/package/debug.md) ^2.6.0
- [httpx](https://npm.io/package/httpx.md) ^2.1.1
- [babel-runtime](https://npm.io/package/babel-runtime.md) ^6.23.0

## Recent versions

- 1.1.6 (latest) — 2018-12-14
- 1.1.5 — 2018-06-26
- 1.1.4 — 2017-11-09
- 1.1.3 — 2017-11-02
- 1.1.2 — 2017-10-27
- 1.1.1 — 2017-08-01
- 1.1.0 — 2017-06-09
- 1.0.4 — 2017-03-02
- 1.0.3 — 2017-02-08
- 1.0.2 — 2017-02-06
- 1.0.1 — 2017-02-06
- 1.0.0 — 2016-12-15

## README

Aliyun API Gateway SDK for Node.js
==================================

API 网关（API Gateway），提供高性能、高可用的 API 托管服务，帮助用户对外开放其部署在 ECS、容器服务等阿里云产品上的应用，提供完整的 API 发布、管理、维护生命周期管理。用户只需简单操作，即可快速、低成本、低风险的开放数据或服务。

> 请注意：由于 API Gateway 需要使用 AK 来实现签名，在浏览器场景下，极易容易产生安全性问题，因此本模块不支持在浏览器中使用。

## Status

[![Build Status](https://travis-ci.org/aliyun/api-gateway-nodejs-sdk.svg?branch=master)](https://travis-ci.org/aliyun/api-gateway-nodejs-sdk)

[![Coverage Status](https://coveralls.io/repos/github/aliyun/api-gateway-nodejs-sdk/badge.svg?branch=es5)](https://coveralls.io/github/aliyun/api-gateway-nodejs-sdk?branch=es5)

## Installation

You can install it as dependency with npm/cnpm.

```sh
$ # save into package.json dependencies with -S
$ npm install aliyun-api-gateway -S
$ # you can use cnpm for fast install
$ cnpm install aliyun-api-gateway -S
```

## Usage

The SDK contains Simple client(authrozied by appcode) and Normal client(authrozied by appid & appsecret).

### Simple client

```js
'use strict';

const SimpleClient = require('aliyun-api-gateway').SimpleClient;
const client = new SimpleClient('YOUR_APP_CODE');

async function post() {
  var url = 'http://apiqingdaohttps.foundai.com/test1234';

  var result = await client.post(url, {
    data: {
      'testtest': 'query1Value'
    },
    headers: {
      accept: 'application/json'
    }
  });

  console.log(JSON.stringify(result));
}

post().catch((err) => {
  console.log(err.stack);
});
```

### Client (recommend)

```js
'use strict';

const Client = require('aliyun-api-gateway').Client;
const client = new Client('YOUR_APP_KEY','YOUR_APP_SECRET');

async function post() {
  var url = 'http://apiqingdaohttps.foundai.com/test1234';

  var result = await client.post(url, {
    data: {
      'testtest': 'query1Value'
    },
    headers: {
      accept: 'application/json'
    }
  });

  console.log(JSON.stringify(result));
}

post().catch((err) => {
  console.log(err.stack);
});
```

## Question?

Please submit an issue.

## License

The MIT License

---
_Source: https://npm.io/package/aliyun-api-gateway · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
