[go: up one dir, main page]

Skip to content

Commit

Permalink
docs(cli): update api template (#60)
Browse files Browse the repository at this point in the history
  • Loading branch information
BuptStEve authored Nov 13, 2018
1 parent 314f318 commit 741de94
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/tua-mp-cli/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@tua-mp/cli",
"version": "0.2.0",
"version": "0.2.1",
"description": "tua-mp 命令行工具",
"bin": {
"tuamp": "bin/tuamp"
Expand Down
2 changes: 2 additions & 0 deletions packages/tua-mp-cli/templates/api/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ export default {
*/
{
path: 'example-path',
// 自定义的新名称
name: 'examplePath',
params: {},
},
],
Expand Down
4 changes: 2 additions & 2 deletions packages/tua-mp-cli/templates/api/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import TuaApi from 'tua-api/dist/mp'
import TuaApi from 'tua-api'

// 初始化
const tuaApi = new TuaApi()
const tuaApi = new TuaApi({ reqType: 'wx' })

// 使用中间件
tuaApi.use(async (ctx, next) => {
Expand Down

0 comments on commit 741de94

Please sign in to comment.