yao <command> [options] [args...]
Command | Description |
---|---|
init | Project initialization |
version | Displays the current version number |
inspect | Display application configuration information |
migrate | Update data table structure |
run | run process |
start | Start WEB service |
socket | Establish Socket connection |
websocket | Establish a WebSocket connection |
dump | Export application data |
restore | Import application data |
Global options:
parameter | shorthand | description |
---|---|---|
--app | -a | Specify application path |
--env | -e | Specify environment variable file |
--help | -h | Command help |
Show Yao version number
yao version
Project initialization, creating files and directories such as app.json, data, models, etc.
cd /path/appyao init
Display application configuration information
cd /path/appyao inspect
Update the database structure and create the data tables defined under the application engine and models folder. By default, the data table associated with the data model under models is updated.
Options:
parameter | shorthand | description |
---|---|---|
--name | -n | Specify model name |
--reset | Rebuild after forced deletion of data table | |
--force | In production mode, force the use of migrate |
cd /path/appyao migrate
cd /path/appyao migrate -n pet
To run the process, the first parameter is the process name, and the rest of the parameters are the process parameter table.
If you need to enter complex data structures, you can use the ::
prefix to declare the parameters in JSON format, for example: '::{"foo":"bar"}'
cd /path/appyao run scripts.day.NextDay 2020-01-02
cd /path/appyao run xiang.flow.Return hello '::{"foo":"bar"}'
start web service
Options:
parameter | shorthand | description |
---|---|---|
--alpha | Enable closed beta feature | |
--debug | Start in development mode |
cd /path/appyao start
cd /path/appyao start --debug
Establish a socket connection. Establishing a Socket Connection Using the Socket Widget DSL
cd /path/appyao socket gate.g02
Establish a WebSocket connection. Establishing a WebSocket Connection Using the Socket Widget DSL
cd /path/appyao websocket message
Export app data
cd /path/appyao dump
Import application data, the parameter is the application data package file exported using the yao dump
command.
cd /path/appyao restore /backup/path/edge-20220827151641.zip
variable | description | default value | example |
---|---|---|---|
YAO_LANG | Command Line Language en-US English zh-CN Simplified Chinese | en-US | zh-CN |
YAO_ENV | Running mode development development environment production production environment | production | production |
YAO_ROOT | Application Directory | Current Directory . | /data/app |
YAO_HOST | WEB service HOST | 0.0.0.0 | 127.0.0.1 |
YAO_PORT | WEB service port | 5099 | 5099 |
YAO_LOG | Application log file location | System stdout | /data/app/logs/application.log |
YAO_LOG_MODE | Log format TEXT | JSON | TEXT | JSON |
YAO_JWT_SECRET | JWT secret | Empty by default | bLp@bi!oqo-2U+hoTRUG |
YAO_DB_DRIVER | database driver mysql | sqlite3 | sqlite3 | mysql |
YAO_DB_PRIMARY | Main database connection | ./db/yao.db | root:123456@tcp(db-server:3306)/yao?charset=utf8mb4&parseTime=True&loc=Local |
YAO_DB_PRIMARY | Slave connection | Empty | root:123456@tcp(db-server:3306)/yao?charset=utf8mb4&parseTime=True&loc=Local |
YAO_DB_AESKEY | Encrypted Field Key (MySQL Only) | Empty | ZLX=T&f6refeCh-ro*r@ |
YAO_SESSION_STORE | Session data storage mode memory | redis | memory | redis |
YAO_SESSION_HOST | Redis server HOST (session storage is valid for redis) | 127.0.0.1 | 127.0.0.1 |
YAO_SESSION_PORT | Redis server port (session storage mode is valid for redis) | 6379 | 6379 |
YAO_SESSION_PASSWORD | Redis password (redis valid for session storage) | empty | 123456 |
Tips: Environment variables can be set individually for applications. Add .env
to the application root directory, and the environment variables declared in .env will be used preferentially when the service is started.
yao <command> [options] [args...]
Command | Description |
---|---|
init | Project initialization |
version | Displays the current version number |
inspect | Display application configuration information |
migrate | Update data table structure |
run | run process |
start | Start WEB service |
socket | Establish Socket connection |
websocket | Establish a WebSocket connection |
dump | Export application data |
restore | Import application data |
Global options:
parameter | shorthand | description |
---|---|---|
--app | -a | Specify application path |
--env | -e | Specify environment variable file |
--help | -h | Command help |
Show Yao version number
yao version
Project initialization, creating files and directories such as app.json, data, models, etc.
cd /path/appyao init
Display application configuration information
cd /path/appyao inspect
Update the database structure and create the data tables defined under the application engine and models folder. By default, the data table associated with the data model under models is updated.
Options:
parameter | shorthand | description |
---|---|---|
--name | -n | Specify model name |
--reset | Rebuild after forced deletion of data table | |
--force | In production mode, force the use of migrate |
cd /path/appyao migrate
cd /path/appyao migrate -n pet
To run the process, the first parameter is the process name, and the rest of the parameters are the process parameter table.
If you need to enter complex data structures, you can use the ::
prefix to declare the parameters in JSON format, for example: '::{"foo":"bar"}'
cd /path/appyao run scripts.day.NextDay 2020-01-02
cd /path/appyao run xiang.flow.Return hello '::{"foo":"bar"}'
start web service
Options:
parameter | shorthand | description |
---|---|---|
--alpha | Enable closed beta feature | |
--debug | Start in development mode |
cd /path/appyao start
cd /path/appyao start --debug
Establish a socket connection. Establishing a Socket Connection Using the Socket Widget DSL
cd /path/appyao socket gate.g02
Establish a WebSocket connection. Establishing a WebSocket Connection Using the Socket Widget DSL
cd /path/appyao websocket message
Export app data
cd /path/appyao dump
Import application data, the parameter is the application data package file exported using the yao dump
command.
cd /path/appyao restore /backup/path/edge-20220827151641.zip
variable | description | default value | example |
---|---|---|---|
YAO_LANG | Command Line Language en-US English zh-CN Simplified Chinese | en-US | zh-CN |
YAO_ENV | Running mode development development environment production production environment | production | production |
YAO_ROOT | Application Directory | Current Directory . | /data/app |
YAO_HOST | WEB service HOST | 0.0.0.0 | 127.0.0.1 |
YAO_PORT | WEB service port | 5099 | 5099 |
YAO_LOG | Application log file location | System stdout | /data/app/logs/application.log |
YAO_LOG_MODE | Log format TEXT | JSON | TEXT | JSON |
YAO_JWT_SECRET | JWT secret | Empty by default | bLp@bi!oqo-2U+hoTRUG |
YAO_DB_DRIVER | database driver mysql | sqlite3 | sqlite3 | mysql |
YAO_DB_PRIMARY | Main database connection | ./db/yao.db | root:123456@tcp(db-server:3306)/yao?charset=utf8mb4&parseTime=True&loc=Local |
YAO_DB_PRIMARY | Slave connection | Empty | root:123456@tcp(db-server:3306)/yao?charset=utf8mb4&parseTime=True&loc=Local |
YAO_DB_AESKEY | Encrypted Field Key (MySQL Only) | Empty | ZLX=T&f6refeCh-ro*r@ |
YAO_SESSION_STORE | Session data storage mode memory | redis | memory | redis |
YAO_SESSION_HOST | Redis server HOST (session storage is valid for redis) | 127.0.0.1 | 127.0.0.1 |
YAO_SESSION_PORT | Redis server port (session storage mode is valid for redis) | 6379 | 6379 |
YAO_SESSION_PASSWORD | Redis password (redis valid for session storage) | empty | 123456 |
Tips: Environment variables can be set individually for applications. Add .env
to the application root directory, and the environment variables declared in .env will be used preferentially when the service is started.