url50r
Version:
http://50r.cn 短网址 node.js SDK
40 lines (25 loc) • 1.07 kB
Markdown
### 50R.CN 短网址 node.js SDK
[](https://www.npmjs.org/package/url50r)
[](https://travis-ci.org/wapznw/nodejs_sdk_50r)
[](https://coveralls.io/github/wapznw/nodejs_sdk_50r?branch=master)
[](https://david-dm.org/wapznw/nodejs_sdk_50r)
使用方法
```
npm install url50r --save
```
```javascript
var url50r = require('url50r')({
ak: '57ac3816d9cb467d121dd48f', // 替换成你自己的 App Key
https: true // 是否启用https
});
var longUrl = 'https://www.google.com.hk/search?q=hello';
url50r.convert(longUrl).then(function (shortUrl) {
console.log(shortUrl);
}).catch(function (err) {
console.error(err);
});
```
[在线运行](http://50r.cn/FIunNQ)
详情请去 [官网](http://50r.cn) 查看帮助。