GithubHelp home page GithubHelp logo

wxapp-api's Introduction

wxapp-api

微信小程序node库

quick start

npm install wxapp-api
var API = require('wxapp-api')
var api = new API(appid, secret)
api.sendMessage(openId, msgType, content, function(err, result){
  if(err) 
    console.log(err)
  doSomething...
})

如采用多节点分布式部署务必提供存取token的方法, token可以统一存在redis中

var API = require('wxapp-api')
var api = new API(appid, secret, getToken, saveToken)
var getToken = function(callback) {
    redis.get('APPID_KEY', function(err, reply){
    callback(reply)
  })
}
var saveToken = function(token, callback) {
  redis.set('APPID_KEY', token)
  callback(null)
}

api.sendText(openId, 'hello_world', function(err, result){

})

接口文档暂时没有来得及更新,接口调用方式比较简单,各位暂时先参考代码注释。

token维护部分代码参考自wechat-api代码

wxapp-api's People

Contributors

whu12yz avatar zjblog avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.