Playframework Do';配置环境';在游戏2.x中存在吗?

Playframework Do';配置环境';在游戏2.x中存在吗?,playframework,playframework-2.1,Playframework,Playframework 2.1,在Play 1.x中,您可以为生产和开发环境定义不同的配置: # These are applied in the default 'dev' enviornment. db=mem mail.smtp=mock # The following are only relevant if 'play id' = prod %prod.db=mysql://prod@db.us.com/ %prod.mail.smtp.host=in.mailjet.com %prod.mail.smtp.use

在Play 1.x中,您可以为生产和开发环境定义不同的配置:

# These are applied in the default 'dev' enviornment.
db=mem
mail.smtp=mock

# The following are only relevant if 'play id' = prod
%prod.db=mysql://prod@db.us.com/
%prod.mail.smtp.host=in.mailjet.com
%prod.mail.smtp.user=mailuser
%prod.mail.smtp.pass=pass
%prod.mail.smtp.channel=ssl

Play 2是否有类似的功能?

它不存在,但您可以告诉Play使用特定的配置文件(例如,您可以有一个“prod”文件,其中可以包含基本配置文件并仅覆盖所需的属性)

请参阅本文档页中的“指定替代配置文件”一节: