第十章 Revel 配置文件app.conf.pdf

  1. 1、本文档共8页,可阅读全部内容。
  2. 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
  3. 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载
  4. 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
Revel 配置⽂件app.conf Revel 配置⽂件概述 app.conf 是Revel程序的配置⽂件,它使⽤ goconfig 语法,类似微软的 INI ⽂件。 下⾯是个例⼦: =chat app.secret=pJLzyoiDe17L36mytqC912j81Pf iolHm1veQK6Grn1En3YFdB5lvE http.addr= http.port=9000 [dev] results.pretty=true watch=true log.trace.output = off .output = stderr log.warn.output = stderr log.error.output = stderr [prod] results.pretty=false watch=false log.trace.output = off .output = off log.warn.output = %()s.log log.error.output = %()s.log 每个段是⼀种 运⾏模式。最上⾯的 key (不 任何段内)对所有的运⾏模式有效。这使 得默认值 所有模式中适⽤,并且根据需要被重写。[prod] 段仅⽤于 ⽣产 模式。 新建的Revel程序中默认定义了 dev 和 prod 模式, 你也可以⾃定义你需要的段。 程序 启动时,根据 (命令⾏⼯具)“revel run” 提供的参数来选择运⾏模式。 ⾃定义属性 开发者可以⾃定义key ,并通过 revel.Config 变量 访问它们。这⾥公开了⼀些简 单的 api 。 内建属性 应⽤程序设置 应⽤程序名称,⽤于控制台输出和开发web页。 例如: = Booking example application 默认值: ⽆值 app.secret 密钥⽤于密码操作 (revel.Sign) 。Revel 内部使⽤它签署session cookies 。设置为 空将禁⽤签名。 使⽤ revel new新建项⽬时,它被设置为⼀个随机的字符串。 例如: app.secret = pJLzyoiDe17L36mytqC912j81Pf iolHm1veQK6Grn1En3YFdB5l 默认值: ⽆值 HTTP settings http.port 监听端⼜ 例如: http.port = 9000 http.addr 监听ip地址 Linux 中, 空字符串代表通配符 – indows中, 空字符串被转换为 localhost 默认值: ”” harness.port Specifies the port for the application to listen on , when run by the harness. For example , when the harness is running , it will listen on http.port, run the application on harness.port, and reverse-proxy requests. ithout the harness, the application listens on http.port directly . 默认情况下,会选择⼀个随​​机的空闲端⼜。这仅仅是必要的,由该程序限制插座访问 的环境中运⾏时设置。By default , a random free port will be chosen . This is only necessary to set when running in an environment that restricts socket access by the program . Default: 0 http.ssl 如果为真, Revel eb服务器将⾃⾏配置为接受SSL连接。这需要⼀个 X509 证书和⼀ 个 key ⽂件。 默认值: false http.sslcert 指定 X509 证书⽂件的路径 默认值: ”” http.sslkey 指定 X509 证书 key的路径 默认值: ”” 响应结果 results.chunked 确定模板渲染时是否使⽤ 分块编码。分块编码可以减少发送到客户端的第⼀个字节的 时间 ( 整个模板已经完全呈现数据之前)。 默认值: false result

您可能关注的文档

文档评论(0)

xuefei111 + 关注
实名认证
内容提供者

该用户很懒,什么也没介绍

1亿VIP精品文档

相关文档