chore: 添加设计资料和示例工程
This commit is contained in:
5
sample/server/etc/sample.env
Normal file
5
sample/server/etc/sample.env
Normal file
@@ -0,0 +1,5 @@
|
||||
# systemd EnvironmentFile 示例,复制为 /data/app/etc/sample.env 后按需修改
|
||||
BSM_Workspace=default
|
||||
BSM_RuntimeMode=prod
|
||||
BSM_Prefix=/data/app
|
||||
BSM_JwtSecretKey=change-me-to-a-random-string
|
||||
16
sample/server/etc/sample.service
Normal file
16
sample/server/etc/sample.service
Normal file
@@ -0,0 +1,16 @@
|
||||
[Unit]
|
||||
Description=Sample Service
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
Restart=always
|
||||
RestartSec=5s
|
||||
EnvironmentFile=/data/app/etc/sample.env
|
||||
ExecStart=/data/app/sample
|
||||
WorkingDirectory=/data/app/
|
||||
StandardOutput=file:/data/app/logs/sample.log
|
||||
StandardError=file:/data/app/logs/sample.error.log
|
||||
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
26
sample/server/etc/sample_dev.yaml
Normal file
26
sample/server/etc/sample_dev.yaml
Normal file
@@ -0,0 +1,26 @@
|
||||
Service: sample
|
||||
Port: 12426
|
||||
|
||||
Databases:
|
||||
Driver: postgres
|
||||
Source:
|
||||
- host=127.0.0.1 user=postgres password=change-me dbname=sample_dev port=5432 sslmode=disable TimeZone=Asia/Shanghai
|
||||
|
||||
# Redis cache example. Replace the password and host before using outside local development.
|
||||
Cache: redis://default:change-me@127.0.0.1:6379/0
|
||||
|
||||
# Enable microservice mode when this sample is deployed behind the service mesh.
|
||||
OnMicroService: false
|
||||
|
||||
# Shared secret for microservice calls. Use a random value in real environments.
|
||||
SecretKey: change-me-to-a-random-string
|
||||
|
||||
# Rpc:
|
||||
# fts:
|
||||
# Endpoint: https://api-v2.traingo.cn/fts/v2
|
||||
# SecretKey: change-me-to-a-random-string
|
||||
|
||||
# Tracing and performance monitoring example.
|
||||
# APM:
|
||||
# Platform: elasticAPM
|
||||
# Endpoint: http://127.0.0.1:14268/api/traces
|
||||
26
sample/server/etc/sample_prod.yaml
Normal file
26
sample/server/etc/sample_prod.yaml
Normal file
@@ -0,0 +1,26 @@
|
||||
Service: sample
|
||||
Port: 12426
|
||||
|
||||
Databases:
|
||||
Driver: postgres
|
||||
Source:
|
||||
- host=db.example.internal user=sample_app password=change-me dbname=sample_prod port=5432 sslmode=require TimeZone=Asia/Shanghai
|
||||
|
||||
# Redis cache example. Replace the password and host before using in production.
|
||||
Cache: redis://default:change-me@redis.example.internal:6379/0
|
||||
|
||||
# Enable microservice mode when this sample is deployed behind the service mesh.
|
||||
OnMicroService: false
|
||||
|
||||
# Shared secret for microservice calls. Use a random value in real environments.
|
||||
SecretKey: change-me-to-a-random-string
|
||||
|
||||
# Rpc:
|
||||
# fts:
|
||||
# Endpoint: https://api-v2.traingo.cn/fts/v2
|
||||
# SecretKey: change-me-to-a-random-string
|
||||
|
||||
# Tracing and performance monitoring example.
|
||||
# APM:
|
||||
# Platform: elasticAPM
|
||||
# Endpoint: http://127.0.0.1:14268/api/traces
|
||||
26
sample/server/etc/sample_test.yaml
Normal file
26
sample/server/etc/sample_test.yaml
Normal file
@@ -0,0 +1,26 @@
|
||||
Service: sample
|
||||
Port: 12426
|
||||
|
||||
Databases:
|
||||
Driver: postgres
|
||||
Source:
|
||||
- host=127.0.0.1 user=postgres password=change-me dbname=sample_test port=5432 sslmode=disable TimeZone=Asia/Shanghai
|
||||
|
||||
# Redis cache example. Replace the password and host before using outside local development.
|
||||
Cache: redis://default:change-me@127.0.0.1:6379/0
|
||||
|
||||
# Enable microservice mode when this sample is deployed behind the service mesh.
|
||||
OnMicroService: false
|
||||
|
||||
# Shared secret for microservice calls. Use a random value in real environments.
|
||||
SecretKey: change-me-to-a-random-string
|
||||
|
||||
# Rpc:
|
||||
# fts:
|
||||
# Endpoint: https://api-v2.traingo.cn/fts/v2
|
||||
# SecretKey: change-me-to-a-random-string
|
||||
|
||||
# Tracing and performance monitoring example.
|
||||
# APM:
|
||||
# Platform: elasticAPM
|
||||
# Endpoint: http://127.0.0.1:14268/api/traces
|
||||
Reference in New Issue
Block a user