feat: delay init table

This commit is contained in:
MiaoWoo 2019-06-12 00:15:41 +08:00
parent 2249552957
commit 0b45fa37da
4 changed files with 57 additions and 1 deletions

11
README.md Normal file
View File

@ -0,0 +1,11 @@
# `cc-server-parent`
> TODO: description
## Usage
```
const ccServerDbMongo = require('cc-server-parent');
// TODO: DEMONSTRATE API
```

39
cli.sh Normal file
View File

@ -0,0 +1,39 @@
#!/bin/bash
set -e
# User Input Variable
action=up
name=
type=micro
while [[ $# -gt 0 ]]; do
case "$1" in
-a)
action="$2"
shift
;;
-n|-p)
name="$2"
shift
;;
-t)
type="$2"
shift
;;
-*)
echo "Illegal option $1"
;;
esac
shift $(( $# > 0 ? 1 : 0 ))
done
case "${action}" in
up)
faas-cli build -f ${name}.yml
faas-cli deploy -f ${name}.yml --label "com.openfaas.scale.zero=true"
;;
create)
faas-cli new ${name} --lang cc-server
;;
esac

View File

@ -5,6 +5,10 @@
"main": "index.js", "main": "index.js",
"author": "MiaoWoo <admin@yumc.pw>", "author": "MiaoWoo <admin@yumc.pw>",
"license": "MIT", "license": "MIT",
"scripts": {
"prepublish": "npx lerna run build",
"lp": "npx lerna publish"
},
"workspaces": [ "workspaces": [
"packages/*" "packages/*"
], ],

View File

@ -27,7 +27,9 @@ export class Controller {
@postConstruct() @postConstruct()
private init(): void { private init(): void {
this.client.setTable(TABLE); setTimeout(() => {
this.client.setTable(TABLE);
}, 50)
} }
@httpGet('/') @httpGet('/')