当前位置: 首页 > 工具软件 > heroku-config > 使用案例 >

heroku常用命令示例(二)

李兴安
2023-12-01
  1. 查看APP的config信息
    该命令的帮助如下:
C:\Users\Benjamin>heroku help config
display the config vars for an app

USAGE
  $ heroku config

OPTIONS
  -a, --app=app        (required) app to run command against
  -j, --json           output config vars in json format
  -r, --remote=remote  git remote of app to use
  -s, --shell          output config vars in shell format

COMMANDS
  config:edit   interactively edit config vars
  config:get    display a single config value for an app
  config:set    set one or more config vars
  config:unset  unset one or more config vars

没大看懂这个帮助,网上简单搜了下也没找到示例,不过也好摸索。
我的APP的名称为chem2reg,开通了postgreSQL数据库,命令示例如下:

C:\Users\Benjamin>heroku config -a chem2reg
=== chem2reg Config Vars
DATABASE_URL: postgres://whmlxlewfscscw:de83f597964fcsssssssss49e638aab946b6e691679dd310d91@ec2-3-233-7-12.compute-1.amazonaws.com:5432/dfsssssss
  1. reset PostgreSQL数据库
    该命令将清空数据库,示例将清空名为chem2reg的APP之下的数据库,示例如下:
C:\Users\Benjamin>heroku pg:reset -a chem2reg
 !    WARNING: Destructive action
 !    postgresql-polished-14609 will lose all of its data
 !
 !    To proceed, type chem2reg or re-run this command with --confirm chem2reg

运行结果:

> chem2reg
Resetting postgresql-polished-14609... done
 类似资料: