File tree Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Original file line number Diff line number Diff line change 1+ # Websocket Client for WeChat Mini Programs
2+
3+ ## About
4+ This plugin is built for developers using Adonis JS with Websockets enabled on the backend and WeChat Mini Programs on the frontend.
5+
6+ You can use all client APIs available in the official browser client (docs here):
7+
8+ [ Adonis Websocket Client Docs] ( https://adonisjs.com/docs/websocket )
9+
10+ ## Setup
11+ 1 . Install the package
12+ ```
13+ npm install adonis-websocket-wechatmp
14+ ```
15+ > You may freely use this NPM package in 3rd party frameworks like Taro, Wepy, MPVue, etc.
16+ >
17+ > Vanilla Framework: [ NPM package install guide] ( https://developers.weixin.qq.com/miniprogram/dev/devtools/npm.html?t=18082018 )
18+
19+ 2 . Then in your Mini Program project:
20+ > ``` /pages/page/page.js ```
21+ > ``` javascript
22+ > import Ws from ' adonis-websocket-wechatmp'
23+ > const ws = Ws (' ws:// -or- wss://your-url-here' )
24+ >
25+ > Page ({
26+ > data: {},
27+ > onLoad () {
28+ > // init websocket connection
29+ > }
30+ > })
31+ > ` ` `
You can’t perform that action at this time.
0 commit comments