We use yaml configuration file. It will be created automatically after answer init command. The default path is /data/conf/config.yaml

config.yaml description

  1. server:
  2. http:
  3. addr: 0.0.0.0:80 # Project access port number
  4. data:
  5. database:
  6. driver: "mysql" # Default database driver is mysql
  7. connection: root:root@tcp(127.0.0.1:3306)/answer # MySQL database connection address
  8. cache:
  9. file_path: "/tmp/cache/cache.db" # Cache file storage path
  10. i18n:
  11. bundle_dir: "/data/i18n" # Internationalized file storage directory
  12. swaggerui:
  13. show: true # Whether to display the swaggerapi documentation, address /swagger/index.html
  14. protocol: http # swagger protocol header
  15. host: 127.0.0.1 # An accessible IP address or domain name
  16. address: ':80' # accessible port number
  17. service_config:
  18. upload_path: "/data/uploads" # upload directory