Home  >  Article  >  php教程  >  KoaHub.js code for connecting printers developed based on Koa platform Node.js

KoaHub.js code for connecting printers developed based on Koa platform Node.js

WBOY
WBOYOriginal
2016-09-23 03:29:591736browse

Recently, many friends are working on WeChat mall projects, so I would like to share with you the code for connecting the WeChat Yilian cloud printer interface with a Node.js web development framework based on the Koa.js platform for everyone to learn from.
koahub-yilianyun

WeChat Yilian Cloud Printer Interface

koahub-yilianyun Yilian cloud printer node interface

Installation

$ npm install koahub-yilianyun
Use with co-request

var printer = require('koahub-yilianyun');
var result = yield printer({
"partner": 914,//User ID (obtained from the management center system integration)
"apikey": "3785b31b2c84f3c47e51a6c4481f8a5fc2eea72a",//apikey (obtained from the management center system integration)
"machine_code": "3400453726",//Printer terminal number
"msign": "gn5p5zk585b6",//Printer terminal key
"time": parseInt(new Date().getTime() / 1000), //Current timestamp (server used for verification timeout)
"content": '2222'//Need to transfer the printed content data
});

KoaHub.js -- Node.js web rapid development framework based on Koa.js platform

Code source: http://js.koahub.com
KoaHub.js code for connecting printers developed based on Koa platform Node.js

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn