我想在自定义域和子域(例如https://api.custom.local/
)下运行我的开发服务器。在Rails
中,我将使用puma-dev
,Phoenix
中是否有与之等效的工具?
答案 0 :(得分:0)
编辑您的config/dev.exs
文件。更改MyApp.Endpoint
的配置。您将要添加或编辑:url
键。您可以执行以下操作
url: [host: "api.custom.local", port: 4000]
然后,您可以像平常一样启动应用程序。
答案 1 :(得分:0)
我一直关注贾斯汀answer,并对puma-dev
进行了一些研究。
我们可以将puma-dev
用作Phoenix应用程序的反向代理。
按照puma-dev
README进行安装。
url: [
sheme: "https",
host: "api.custom.test"
],
https: [
port: 443,
cipher_suite: :strong,
keyfile: System.get_env("SSL_KEYFILE_PATH"),
certfile: System.get_env("SSL_CERTFILE_PATH")
]
我们可以访问https://api.custom.test
puma-dev
允许通过执行puma-dev -install -d local