create-zoom-bot
write bot app for zoom
Installation && Create project
npm i create-zoom-bot -g //will have command interaction to prompt what modules to use, and whether to use react page. create-zoom-bot create asana create-zoom-bot create asana --nowrap // create structure in current root dir,not wrap in a dir // point dir to createcreate-zoom-bot create asana --nowrap --dist /asana // if you only want to create serverless config file to your current dir//you can use "create-zoom-bot init" or "create-zoom-bot init --dist lti" //to only create config files in you current dir // if you have create bot template,and want to add static single,you can use "create-zoom-bot create-static" to create static directory in current dir
development in local
//run backend servicenpm run start orsls offline --stage local //run frontendnpm run start-static //build frontendnpm run build-static
use dynamodb local
//install && start npm run dynamodb //npm run dynamodb -- --port 8089 or sls dynamodb install //in your root directorysls dynamodb start --port 8089 //run dynamodb port //remove npm run dynamodb-remove // rm -r can't use in windows or sls dynamodb remove delete dynamodb //and then you can use dynamodb local just like new AWS.DynamoDB.DocumentClient() ...
development react page
we use antd for the default ui lib,and inject zoom ui variables in it,and you don't need to config webpack,just use "import {Button} from antd" to use components,and you can write code in "./static/src/app/Home.js" to write your code directly.
use quick-react-webpack to start react project,and default config is done, in general, no special Settings are required,if you have some special config,you can write it in ./appconfig.js
json serverless.dev|prod|local.json template notice
"app":"appName"//app name which your prefix path and application&&function name,will auto create by structure created "handler":"app/index.handler"//optional,which file you want to bind with your js,default is app/index.handler "environment":"app":"appName"//will auto create by structure created "exclude"://optional,the files&&dirs which you want to exclude "timeout":10 //timeout which you want to special "stages": "static":false//default in static directory,and build in staticBuild directory "test":false//default run npm run test in root directory //in local.json,can config custom dev port ... "serverless-offline": "port": 3000 "static": "port": 3003 ... "environment": "staticPort": 3003
Pay attention to
Because we need all lambda functions to be one domain name,We used serverless's share API gateway,so you need add you appName as prefix in you router ,we can distinguish different bot by app name To satisfy that under the same domain . If you not add prefix with your router,you won't get your response. example as follows
//template have already add follow prefix,so you don't need to add extra prefixapp;
config file
- in serverless.*.json change your app name,timeout,and environment,no need to add bucket and role and others,because these args is secret,we will add it in zoom deploy env